Convert xlsx to csv in linux command line

calendar_today Asked May 11, 2012
thumb_up 96 upvotes
history Updated April 16, 2026

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)

Top excel Q&A (6)

+96 upvotes ranks this answer #3 out of 167 excel solutions on this site — top 2%.