Libreoffice将html转换为xls或xlsx [英] Libreoffice converting html to xls or xlsx

查看:662
本文介绍了Libreoffice将html转换为xls或xlsx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Libreoffice将HTML文件转换为XLS或XLSX格式。

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

使用LibreOffice 4.0.4.2在CentOS 6.5版(Final)上运行
我可以使用以下命令将简单的html转换为Microsoft XLS。

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 - 转换为xls my_file .html

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

我一直在最新的LibreOffice 5.0.4.2测试,没有成功。
我使用以下命令并包括过滤器:

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 - 无 - 转换为xls :MS Excel 97test.html

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

它返回以下内容。

转换/path/to/test.html - > /path/to/test.xls使用过滤器:MS
Excel 97覆盖:/path/to/test.xls错误:请验证输入
参数...(SfxBaseModel :: impl_store
失败:0xc10)

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)

在解密错误方面取得了成功。
任何技巧赞赏使用libreoffice(最新版本)从HTML转换为XLS / XLSX赞赏...以及可以完成相同任务的其他开源工具。

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.

推荐答案

我解决问题之前,我尽快发布问题。

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

答案..保存你

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

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


  • 或更简单 -

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

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

完美工作,相对直观。

这篇关于Libreoffice将html转换为xls或xlsx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆