Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libreoffice converting html to xls or xlsx

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.

like image 947
user3666158 Avatar asked Dec 18 '15 19:12

user3666158


1 Answers

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!

like image 160
user3666158 Avatar answered Oct 23 '22 00:10

user3666158