3

is there anyway to save csv file as an excel files using shell scripts/command prompt?

I know that I can do it manually via the save as in the excel gui, but how do I make it an automated process?

Thanks!

4
  • 1
    mv {file}.csv {file}.xls ? Commented Feb 28, 2013 at 19:20
  • do you mean a script to convert all of your .csv to .xls? Commented Feb 28, 2013 at 19:20
  • You can use vbscript to do this. support.microsoft.com/kb/198703 Commented Feb 28, 2013 at 19:27
  • mv xx.csv yy.xls doesn't convert csv properly i think Commented Mar 1, 2013 at 20:48

3 Answers 3

4

csv2odf:

csv2odf data.csv template.xlsx output.xlsx
Sign up to request clarification or add additional context in comments.

1 Comment

this works on both windows and linux, and tiny enough compared to the huge dependencies of ssconvert/gnumeric. thanks
0

If you don't mind doing it from within Excel, you can probably do something with VBA which will process multiple files at the same time.

Rather like: http://www.go4expert.com/forums/convert-xls-csv-using-vbscript-t18188/ but changing the saveas type.

Comments

0

Take a look at http://www.perlmonks.org/?node_id=635437 You can use Perl Modules to parse and write Excel spread sheets.

You will need:

https://metacpan.org/pod/Spreadsheet::WriteExcel
and
https://metacpan.org/pod/Text::CSV::Simple

or

sudo apt-get install libspreadsheet-writeexcel-perl libtext-csv-perl

Then that script should work for you -

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.