使用命令行在Linux中将xlsx转换为csv [英] Convert xlsx to csv in Linux with command line
问题描述
我正在寻找一种在Linux上将xlsx文件转换为csv文件的方法.
I'm looking for a way to convert xlsx files to csv files on Linux.
我不想使用PHP/Perl或类似的东西,因为我正在考虑处理几百万行,所以我需要快速的东西.我在Ubuntu仓库中找到了一个名为xls2csv的程序,但它只能转换xls(Office 2003)文件(我当前正在使用),但是我需要支持较新的Excel文件.
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.
有什么想法吗?
推荐答案
数字电子表格应用程序已发布使用名为 ssconvert 的命令行实用程序各种电子表格格式:
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
要在Ubuntu上安装:
apt-get install gnumeric
要在Mac上安装:
brew install gnumeric
这篇关于使用命令行在Linux中将xlsx转换为csv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!