在Linux命令行中将xlsx转换为csv [英] Convert xlsx to csv in linux command line

查看:3567
本文介绍了在Linux命令行中将xlsx转换为csv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来将linux中的xlsx文件转换为csv文件,我不想使用PHP / Perl或类似的东西,因为我正在处理几百万行,所以我需要一些快速。我发现一个程序在ubuntu repo的名为xls2csv,但它只会转换xls(Office 2003)文件(我目前使用),但是,我需要添加支持更新的excel文件,任何想法?

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?

推荐答案

Gnumeric 电子表格应用程序附带了命令行实用程序,名为 ssconvert ,可在命令行上在各种电子表格格式之间转换:

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

要在Ubuntu上安装:

apt-get install gnumeric

这篇关于在Linux命令行中将xlsx转换为csv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆