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?

解决方案

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

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐