Libreoffice converting html to xls or xlsx

隐身守侯 提交于 2019-12-09 18:34:10

问题


I am trying to use Libreoffice to convert a HTML file to XLS or XLSX format.

With LibreOffice 4.0.4.2 running on CentOS release 6.5 (Final) I was able to convert simple html to Microsoft XLS with the following command.

soffice --headless --convert-to xls my_file.html

I've been testing on the latest LibreOffice 5.0.4.2 without success. I'm using the following command and including the filter:

libreoffice5.0 --headless --convert-to xls:"MS Excel 97" test.html

It returns the following.

convert /path/to/test.html -> /path/to/test.xls using filter : MS Excel 97 Overwriting: /path/to/test.xls Error: Please verify input parameters... (SfxBaseModel::impl_store failed: 0xc10)

I haven't had any success in deciphering the error. Any tips appreciated on using libreoffice (recent versions) to convert from HTML to XLS/XLSX appreciated ... as well as other opensource tools that can accomplish the same task.


回答1:


No sooner do I post the question than I solve my problem.

The answer .. to save you the trouble in the future.

libreoffice5.0 --headless --calc --convert-to xls:"MS Excel 97" test.html

  • or more simply -

scalc --headless --convert-to xlsx test.html

Works perfectly ... and is relatively intuitive.



来源:https://stackoverflow.com/questions/34362464/libreoffice-converting-html-to-xls-or-xlsx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!