Can you echo results to an excel file
I realized I could print results to a .csv but I wanted to know if I could print results to certain columns and rows I assign. I thought that would be something fun to learn.
|
look into awk for any column parsing functionality.
also supposedly there are some perl utilities out there that can convert .csv files into binary coompatable .xcl ms-excel formatted files. |
I agree with schneidz, it could be easily done with Perl, probably it would be good if you posted an example-file and explain your problem in more detail.
Markus |
well I thought it would be cool if I echoed items and could place them columns and rows in excel. Not long ago I started learning how to use imagemagick and some its features. I started setting thing as variables and I thought it would be fun to learn how to set each variable in a column and start a new row. I dont really have anything just something I wanted to learn.
|
Well, I think independent from the language or command you use, the way to put data into a csv-file will always be, to split the line and putting the data into a list. As an example (Perl-code), when the delimiter in the lines is a ";"
Code:
my @data = split /;/, $line ; Now one could substitute (or set) the data Code:
$data[3]="my new data" ; and join the array to a string Code:
$newline = join /;/, @data ; Markus |
someone else also mentioned awk. Can you point where some good tutorials and reads would be for awk as well?
|
There are several places in the internet with tutorials about bash and awk, take also a look at sed.
http://bashshell.net/stream-filterin...ng-awk-basics/ http://www.delorie.com/gnu/docs/gawk...l#SEC_Contents http://tldp.org/LDP/abs/html/awk.html but here's also the whole tutorial (which actually is an advanced bash-guide) very valuable http://tldp.org/LDP/abs/html/ I learned sed with this tutorial http://www.grymoire.com/Unix/Sed.html Maybe it would be useful to purchase a book, normally a good book about bash will also have chapters with awk and sed. Markus |
A little off-topic. A csv-file is not the same as an excel-file ;)
|
Quote:
Markus |
thats a good point... ascii (including .csv or .xml) is the most trans-portable format so dealing with .csv (which ms-excel can handle) is easier with trying to translate .xcl files into ascii without a gui.
i remember using a program that would transform open-office odf into ms-excel format (so you can do hundreds at a time) but i forget what it was called. |
Quote:
|
Quote:
|
See, excel has its own proprietary format. So you need specific modules to post your data into excel format and that includes specific rows and columns.
I believe that perl has just such modules. awk as such doesn't have the functionality that you need. OK |
How about a script to
If you don't want to see the Excel file on screen, you could start LibreOffice headless. |
i see this. not sure if it goes the other way:
Code:
xlhtml.x86_64 : Excel 95/97 and PowerPoint to HTML converter |
All times are GMT -5. The time now is 11:08 AM. |