linux命令行界面转换xls到csv

网上看了,有两个软件,

一个是catdoc (这个实在不靠谱,如果你的表格有日期的话,日期肯定不正确....)

 

另一个是xls2doc (这个还可以,但是安装模块有点烦)

 

xls2doc安装过程

先安装相关模块

 

 
 
  1. [root@test new]# perl -MCPAN -e shell 
  2. cpan> install Locale::Recode 
  3. cpan> install Unicode::Map 
  4. cpan> install Spreadsheet::ParseExcel 
  5. cpan> install Text::CSV_XS 
  6. cpan>q 
  7. Terminal does not support GetHistory. 
  8. Lockfile removed. 

模块安装好后,

直接解压,安装

 
 
  1. perl Makefile.PL 
  2. make 
  3. make test 
  4. make install 

安装路径

 
 
  1. [root@test new]# whereis xls2csv 
  2. xls2csv: /usr/bin/xls2csv /usr/share/man/man1/xls2csv.1 

使用方法

        -x     : filename of the source spreadsheet
        -b     : the character set the source spreadsheet is in (before)
        -c     : the filename to save the generated csv file as
        -a     : the character set the csv file should be converted to (after)
        -q     : quiet mode
        -s     : print a list of supported character sets
        -h     : print help message
        -v     : get version information
        -W     : list worksheets in the spreadsheet specified by -x
        -w     : specify the worksheet name to convert (defaults to the first worksheet)

 

 
 
  1. xls2csv -x myfile.xls -c myfile.csv 
  2. xls2csv -x myfile.xls -c myfile.csv -w worksheet_name 

 

本文转自 nonono11 51CTO博客,原文链接:http://blog.51cto.com/abian/1126350,如需转载请自行联系原作者

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值