Question posted 2012 · +108 upvotes
I’m looking for a way to convert xlsx files to csv files in linux, i do not want to use PHP/Perl or anything like that since I’m looking at processing several millions of lines, so i need something quick. I found a program on the ubuntu repo’s called xls2csv but it will only convert xls(Office 2003) files(which i’m currently using) but, i need to add support for the newer excel files, any ideas?
Accepted answer +96 upvotes
The Gnumeric spreadsheet application comes with a commandline utility called ssconvert that can convert between a variety of spreadsheet formats on the commandline:
$ ssconvert Book1.xlsx newfile.csv
Using exporter Gnumeric_stf:stf_csv
$ cat newfile.csv
Foo,Bar,Baz
1,2,3
123.6,7.89,
2012/05/14,,
The,last,Line
To install on Ubuntu:
apt-get install gnumeric
2 code variants in this answer
- Variant 1 — 9 lines, starts with
$ ssconvert Book1.xlsx newfile.csv - Variant 2 — 1 lines, starts with
apt-get install gnumeric
External references cited (2)
- projects.gnome.org — Gnumeric
- help.gnome.org — ssconvert
Top excel Q&A (6)
- Shortcut to Apply a Formula to an Entire Column in Excel +335 (2011)
- How should I escape commas and speech marks in CSV files so they work in Excel? +136 (2012)
- How to create a link inside a cell using EPPlus +50 (2011)
- IF statement: how to leave cell blank if condition is false ("" does not work) +44 (2013)
- T-SQL: Export to new Excel file +44 (2012)
- Generating CSV file for Excel, how to have a newline inside a value +41 (2009)
excel solutions on this site
— top 2%.