网上看了,有两个软件,

一个是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