Is it possible to write to an excel sheet(any type) from a bash script ?
What I am looking for is something along these lines :
sed -e :a -e '$!N; s/\n/ /; ta' file.c > #( first coloumn ,second row of the spread sheet )
echo "$cdvar" > #( second coloumn ,third row of the spread sheet )
Thank you for your replies and suggestion .
You could write excel by
bash
,perl
,python
, .. I think that each program language has its solutions.bash
You could use
join
orawk
, and I think that there are other solutions.join
If you want
join
to files with same column, look these posts: Bash join command and join in bash like in SASawk
You could write a csv, but you could
rename
intoxls
and then with excel, gnumeric, or other programs, it is recognized like xls.when you modify xls with excel, gnumeric, or other programs, and save in xls, you could not read by bash. So that @Geekasaur recommended
perl
orpython
solutions.perl
You could write
xls
in perl, follow a sample:And then you could modify
xls
withSpreadsheet::ParseExcel
package: look How can I modify an existing Excel workbook with Perl? and "This link is broken and has been reported to IBM" reading and writing samplepython
You could write real
xls
in python, follow a sample:And then you could also
convert
to csv with this sourceforge project. And if you could convert to csv, you could rewrite xls.. modifing the script.You can easily do this by first creating a R script (xsltocsv), and then calling it from your Bash file.
The R script would look something like:
Let us say that you put this into your system path after making the file executable (
chmod +x xsltocsv
). Then, invoke this script passing the associated parameters, and you are good to go ;)