Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert xlsx to csv in Linux with command line

I'm looking for a way to convert xlsx files to csv files on 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 repos called xls2csv but it will only convert xls (Office 2003) files (which I'm currently using) but I need support for the newer Excel files.

Any ideas?

like image 814
user1390150 Avatar asked May 11 '12 19:05

user1390150


People also ask

How do I convert XLSX to CSV in Linux?

Gnumeric Spreadsheet Program To install Gnumeric in Linux use the apt-get command to install the Gnumeric repository via Linux terminal. Now to convert xlsx format to csv format using ssconvert command of Gnumeric to convert the file. To view the contents of the file using the cat command to check the csv file.

How do I convert XLSX to XLS in Linux?

The first method is to use Gnumeric. Gnumeric is a free spreadsheet program which can import or export data in different file formats such as csv , xls and xlsx . Gnumeric comes with a command-line utility called ssconvert which can convert between different spreadsheet file formats.


Video Answer


1 Answers

The Gnumeric spreadsheet application comes with a command line utility called ssconvert that can convert between a variety of spreadsheet formats:

$ 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 

To install on Mac:

brew install gnumeric 
like image 193
jmcnamara Avatar answered Oct 11 '22 16:10

jmcnamara