简体   繁体   English

Libreoffice 将 html 转换为 xls 或 xlsx

[英]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.

相关问题 使用xsl将html转换为xls - Converting html to xls using xsl 将XML转换为HTML-使用PHP和XLS模板 - Converting XML to HTML - Using PHP and XLS template Python中的自动化:将混合xls转换为html - Automation in Python: Converting hybrid xls to html 使用libreoffice将HTML转换为DOCX时丢失上标标记 - Losing superscript tag when converting HTML to DOCX using libreoffice LibreOffice Basic Macro命令将calc cellRange转换为RTF / HTML - LibreOffice Basic Macro command converting Calc cellRange to RTF/HTML 使用 jQuery 或 JavaScript 将 html 表导出到多个工作表 xlsx 文件而不是 xls - Export html tables to multiple sheets xlsx file not xls using jQuery or JavaScript 如何在html的表单标签的浏览按钮中过滤xls,xlsx和csv扩展文件? - How to filter xls,xlsx and csv extension files in browse button of form tag of html? 有没有一种方法可以使用NPOI / C#将HTML表转换为xls / xlsx文件? - Is there a way to convert a HTML table to xls / xlsx-file using NPOI/C#? LibreOffice Writer在转换为html时在偶数页中不显示页脚 - LibreOffice Writer doesn't show footer in even pages when converting to html PHP将Excel文件从“.xls”转换为“.xlsx” - PHP Convert Excel File From “.xls” To “.xlsx”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM