0
votes

What conventional tool for shell scripting allows me to convert a .csv file with a header row into LibreOffice .ods format?

Things I've tried, that ignored my headers:

  • soffice --headless --convert-to ods GPW.99.csv
  • unoconv -f ods -o dir dir/GPW.99.csv # cannot find any -i parameter documentation for csv filter
  • google docs upload dir/GPW.99.csv

The last example is even better, sending directly to Google Drive so that I don't have to email the attachment from the bash shell, however, the column names are still A, B, C, etc. and not as listed in row 1, which gets imported as a data row instead.

1
I am figuring out one way to do this with the Ruby roo gem. When I have a (long?) working one-liner shell command, will post back here.Marcos

1 Answers

0
votes

csv2odf can do that:

csv2odf -H GPW.99.csv template.ods output.ods

The -H option tells it to use the header row from the csv file.