Ask Your Question
0

Filter for ODS in --convert-to is not OpenDocument Spreadsheet Flat XML

asked 2019-03-19 02:30:37 +0200

Tobruk gravatar image

updated 2019-03-19 02:34:41 +0200

I've found the filter for this format here: https://cgit.freedesktop.org/libreoff... as suggested in this topic: https://ask.libreoffice.org/en/questi....

When I type in the command:

libreoffice6.2 --convert-to ods="OpenDocument Spreadsheet Flat XML" *.doc

I get an error:

Error: no export filter for /media/.../test/Absent_en.ods=OpenDocument Spreadsheet Flat XML found, aborting. Error: no export filter

I tried other combinations like doc>pdf and doc>odt and they all worked just by writing odt and pdf into the command, but for some reason even that lengthy filter is not enough!

Please help

P.S Other sites (like this one: http://www.ubuntubuzz.com/2016/08/lib...) propose using

libreoffice6.2 --headless --convert-to ods *.doc

but even adding --headless doesn't work

edit retag flag offensive close merge delete

Comments

By the way - the "Flat" part of the question is unclear - ODS is not a Flat XML format: FODS is.

Mike Kaganski gravatar imageMike Kaganski ( 2019-03-19 06:32:43 +0200 )edit

I'm just citing an official source that contains filter names for file formats. Maybe objectively speaking it is not flat, but it is definitely called that way internally.

Tobruk gravatar imageTobruk ( 2019-03-19 17:40:46 +0200 )edit

No, they are not :-) you just found the .XCU for FODS. For proper ODS, ther's another .XCU: https://cgit.freedesktop.org/libreoffice/core/tree/filter/source/config/fragments/filters/calc8.xcu. The naming of our files reflects long legacy of the suite history ;-)

Mike Kaganski gravatar imageMike Kaganski ( 2019-03-19 18:08:03 +0200 )edit

Fair point then, won't argue :)

Tobruk gravatar imageTobruk ( 2019-03-19 18:25:27 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2019-03-19 06:28:12 +0200

Well - of course, the 'ods="OpenDocument Spreadsheet Flat XML"' format is invalid - could you please share where did you find that syntax, so that we could clarify/fix the wrong statement. The relevant help topic mentions how to properly specify the specific filter - using colon ...

But then - the command with the proper syntax would not work, either. Because your conversion - from binary text document format DOC to spreadsheet ODS - does not generally make sense.

In general, when you try some automated conversion using --convert-to, you possibly first want to test how to do that manually, using GUI. You first open the original file with LibreOffice - e.g., use "Open with LibreOffice" shell function, or somesuch, which invokes generic soffice file.ext-like command. Then you try to save as/export to a desired file type, and see if it's possible. If it is not, then likely it also won't work in command like, unless you do some additional steps.

E.g., you might need to open the file specially. This is the case when people want to convert PDFs to text documents: by default, PDFs are opened using Draw module in LibreOffice; and Draw does not have export filters to save to text documents. But LibreOffice can import to Writer if told so explicitly - so one would need to specify import filter first, to be able then to export to desired text document format. So one would see that special treatment was needed when opening in GUI: one has to specify import filter in Open dialog explicitly - and that would give a hint about what is needed in automated scenario.

Or one could need to do an extra conversion step. This is the case here: only Calc can export to ODS - so you need to open document in Calc; but there's no import filter for DOC in Calc. Still, there are text formats that may be imported to Calc: they are RTF and HTML. So - you could want to open your DOC in Writer, then export to RTF, then open the exported RTF in Calc (explicitly specifying import filter), then export to ODS ... for whatever reason.

edit flag offensive delete link more

Comments

This worked. Also some combinations that didn't worked before started working when I appended --calc to the command. Thanks

Tobruk gravatar imageTobruk ( 2019-03-19 17:46:06 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-03-19 02:30:37 +0200

Seen: 101 times

Last updated: Mar 19