网上看了,有两个软件,
一个是catdoc (这个实在不靠谱,如果你的表格有日期的话,日期肯定不正确....)
另一个是xls2doc (这个还可以,但是安装模块有点烦)
xls2doc安装过程
先安装相关模块
- [root@test new]# perl -MCPAN -e shell
- cpan> install Locale::Recode
- cpan> install Unicode::Map
- cpan> install Spreadsheet::ParseExcel
- cpan> install Text::CSV_XS
- cpan>q
- Terminal does not support GetHistory.
- Lockfile removed.
模块安装好后,
直接解压,安装
- perl Makefile.PL
- make
- make test
- make install
安装路径
- [root@test new]# whereis xls2csv
- 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)
- xls2csv -x myfile.xls -c myfile.csv
- xls2csv -x myfile.xls -c myfile.csv -w worksheet_name
本文转自 nonono11 51CTO博客,原文链接:http://blog.51cto.com/*/1126350,如需转载请自行联系原作者