The xlsx file name extension is a new file format based on XML, used by Microsoft Office Excel 2007 spreadsheet application. The letter "x" appended to the existing "xls" extension used by earlier versions of Excel, signifies that the format is based on XML. If you would like to open or edit an xlsx file created by Excel 2007, on an earlier version of Excel or any other spreadsheet application, you need to convert xlsx files first.

There are four different ways you can convert xlsx files on 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. In order to convert xls files to xls or csv format by using Gnumeric, first install Gnumeric. Once Gnumeric is installed, you can use ssconvert.

$ sudo apt-get install gnumeric

Note that ssconvert accepts arguments in the following format.

$ ssconvert --export-type=ID [input file] [output file]

In the above, "--export-type" is optional, and without "--export-type", ssconvert can infer export type from the extension of output file. If you want to explicitly specify export type, ID can be one of the following.

The drawback of the above method of converting xlsx files using Gnumeric is that you need to install Gnumeric which may be too bloated software to install just for file conversion. A more lightweight way is to use xlsx2csv which is a python tool for xlsx to csv conversion.

Besides Gnumeric and xlsx2csv, you can also use OpenOffice to perform xlsx format conversions. OpenOffice comes with a command-line utility called unoconv which can convert .xlsx files.

$ sudo apt-get install unoconv
$ unoconv -f csv input.xlsx

Note that once you install unoconv using apt-get, it will install OpenOffice package as well.

The final method of converting xlsx files is to use Google Spreadsheets. Google Spreadsheets can import Excel 2007 files. Thus, all you have to do is to import your .xlsx file on to Google Docs Spreadsheet, click "Download as" menu, and choose an appropriate file format: Excel (.xls), PDF, CSV, Text. Note that document files which can be uploaded to Google Docs for conversion cannot be larger than 2MB.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

How do we convert large csv files to xls? gnumeric cannot convert more than about 65580 lines to xls at the same time. The csv file has to be split then converted. Do we have an efficient way to do it?