Ask Your Question
0

convert excel 2003 spreadsheet xml to any format xls or xlsx or ods

asked 2020-06-27 18:10:15 +0200

dansei gravatar image

updated 2020-06-27 18:32:12 +0200

Team,

I have a 2003 excel spreadheet excel.

I need to convert this eventually to excel for parsing.

I have looked at many links and have tried to run soffice cmds.

The xml file can be opened manually bia libreoffice calc and saved to another format.

HOwever, I need to do this automatically via headless for data processing

Any ideas here?

LInks I referrred to https://ask.libreoffice.org/en/questi...

https://cgit.freedesktop.org/libreoff...

cmds I have run, all render an empty spreadsheet.

MS Excel 97 soffice --headless --convert-to ooxml:"Calc Office Open XML" prefcardPositionExample.xml

soffice --headless --convert-to ods prefcardPositionExample.xml

soffice --headless --convert-to xls prefcardPositionExample.xml

soffice --headless --convert-to xlsx prefcardPositionExample.xml

C:\fakepath\prefcardPositionExample.xls

edit retag flag offensive close merge delete

Comments

So what does the file contain? Anything that would require the GUI?

erAck gravatar imageerAck ( 2020-06-27 18:25:47 +0200 )edit

trying to attach the file now.

dansei gravatar imagedansei ( 2020-06-27 18:28:44 +0200 )edit

I added the file in the last line of the original post.

Not sure why is says fakepath and I had to change the extenstion to xls in order for it to be uploaded.

It is xml.

dansei gravatar imagedansei ( 2020-06-27 18:31:58 +0200 )edit

Which operating system are your working on?


libreoffice6.4 --convert-to ods prefcardPositionExample.xml provides the following result for me:
C:\fakepath\prefcardPositionExample.ods on Linux openSUSE 15.1 using LibreOffice 6.4.4.2 (from TDF packages), which isn't empty at least (can't comment on the content). All other conversions provide a file with content as well.

Opaque gravatar imageOpaque ( 2020-06-27 19:00:02 +0200 )edit

I am running the below

$ soffice --version LibreOffice 6.0.7.3 00m0(Build:3)

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.4 LTS Release: 18.04 Codename: bionic

dansei gravatar imagedansei ( 2020-06-27 19:09:30 +0200 )edit

I suppose I could run your stack in docker ( or try to upgrade my libreoffice ) to do the parsing and export it to a storage location.

dansei gravatar imagedansei ( 2020-06-27 19:12:14 +0200 )edit

Your output looks good.

dansei gravatar imagedansei ( 2020-06-27 19:12:31 +0200 )edit

I updated my libreoffice and still get blank file output

$ libreoffice --version LibreOffice 6.4.4.2 40(Build:2)

(base) chris@chris-Precision-5530:~/Downloads$ libreoffice --version LibreOffice 6.4.4.2 40(Build:2)

$ soffice --convert-to ods prefcardPositionExample.xml convert /home/chris/Downloads/prefcardPositionExample.xml -> /home/chris/Downloads/prefcardPositionExample.ods using filter : calc8 Overwriting: /home/chris/Downloads/prefcardPositionExample.ods

dansei gravatar imagedansei ( 2020-06-27 19:50:36 +0200 )edit

Could reproduce your problem on Ubuntu 18.04 - regardless of using LibreOffice from base repos (6.0.7), PPA repos (6.4.4.2) or TDF packages (6.4.4). The resulting .ods file shows no content.


In addition: Same problem seems to appear in Ubuntu 20.04 (tested LibreOffice 6.4.3.2 from base package repository). I tend to assume a general problem on Ubuntu itself.

On Ubuntu can't even load the .xml file into Calc. Hence it seems the problem to start at import already.

Opaque gravatar imageOpaque ( 2020-06-28 16:35:21 +0200 )edit

Hooray for Ubuntu.

The attached XML is the awkward Excel 2003 XML file format to be read either (old way) by an even more dreaded XSLT filter to import to LibreOffice, or (new way) using liborcus. Seems Ubuntu lacks a piece to make that work. It's odd that even the TDF provided build fails on Ubuntu.

erAck gravatar imageerAck ( 2020-06-30 18:29:45 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-06-30 19:23:16 +0200

Opaque gravatar image

updated 2020-06-30 20:09:29 +0200

Hello,

the following command works for me on Ubuntu 18.04 and 20.04

soffice --headless --infilter="MS Excel 2003 XML" --convert-to ods prefcardPositionExample.xml

(Due to luck only, in my earlier tests also tried option --infilter but using the filter name as it appears in file picker dialog, which is Microsoft Excel 2003 XML and this hadn't any effect")

In addition it is completely unclear to me,

Tested with LibreOffice (Ubuntu 18.04)

Version: 6.0.7.3, Build-ID: 1:6.0.7-0ubuntu0.18.04.10
CPU-Threads: 4; BS: Linux 5.3; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

Tested with LibreOffice (Ubuntu 20.04)

Version: 6.4.3.2, Build-ID: 1:6.4.3-0ubuntu0.20.04.1
CPU-Threads: 1; BS: Linux 5.4; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE, Calc: threaded

Hope that helps.

edit flag offensive delete link more

Comments

Team,

this worked 100% on my platform

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.4 LTS Release: 18.04 Codename: bionic

:~/Downloads$ soffice --headless --infilter="MS Excel 2003 XML" --convert-to ods prefcardPositionExample.xml ~/Downloads$ soffice --headless --infilter="MS Excel 2003 XML" --convert-to xls prefcardPositionExample.xml

dansei gravatar imagedansei ( 2020-06-30 20:10:07 +0200 )edit

Team,

who is Team (sounds like your are working at IBM)?

Opaque gravatar imageOpaque ( 2020-07-01 12:08:57 +0200 )edit

Opaque, Thanks for your response and I appreciate all responses from all above. Thank you and Thank you all

dansei gravatar imagedansei ( 2020-07-01 14:48:16 +0200 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2020-06-27 18:10:15 +0200

Seen: 38 times

Last updated: Jun 30