[英]Libreoffice converting html to xls or xlsx
I am trying to use Libreoffice to convert a HTML file to XLS or XLSX format.我正在尝试使用 Libreoffice 将 HTML 文件转换为 XLS 或 XLSX 格式。
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.通过在 CentOS 6.5 版(最终版)上运行的 LibreOffice 4.0.4.2,我能够使用以下命令将简单的 html 转换为 Microsoft XLS。
soffice --headless --convert-to xls my_file.html
soffice --headless --convert-to xls my_file.html
I've been testing on the latest LibreOffice 5.0.4.2 without success.我一直在测试最新的 LibreOffice 5.0.4.2 但没有成功。 I'm using the following command and including the filter:
我正在使用以下命令并包括过滤器:
libreoffice5.0 --headless --convert-to xls:"MS Excel 97" test.html
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)
使用过滤器转换 /path/to/test.html -> /path/to/test.xls:MS Excel 97 覆盖:/path/to/test.xls 错误:请验证输入参数...(SfxBaseModel::impl_store 失败: 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.
任何有关使用 libreoffice(最新版本)将 HTML 转换为 XLS/XLSX 的技巧都值得赞赏……以及可以完成相同任务的其他开源工具。
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!完美运行并且相对直观!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.