Ask Your Question
0

How to convert to CSV with UTF-8 encoding using LO5 command line? [closed]

asked 2018-02-02 19:05:09 +0100

Libre0fficer gravatar image

updated 2018-02-02 22:13:20 +0100

erAck gravatar image

When I try

soffice --headless --convert-to csv myfile.xlsx

the resulting file has no UTF-8 encoding.

I found out that I have to use the output filter "Text - txt - csv (StarCalc)" followed by a list of parameters, like so:

soffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":<listofparameters>

The Problem is none of the solutions I found worked for me. I always get the error message:

Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///path/to/myfile.csv> failed: 0x81a)

I noticed that the solutions I found refered to LO4. So maybe the input format has changed? Unfortunately, I can't find any documentation on that.

My LibreOffice version is 5.4.2.2

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by erAck
close date 2018-02-05 16:30:24.759293

Comments

And what did you specify for <listofparameters>?

erAck gravatar imageerAck ( 2018-02-02 21:47:33 +0100 )edit

I found examples with 3, 5, 7 or 9 paramters, mostly from other questions on ask.libreoffice.org. E.g "59,34,0" or "59,34,76,,,,true" or "59,34,0,0,1". The odd thing is, they all work now. I'm not sure what has changed. I tried to make it work like 2h and double and triple checked the syntax. Still seems like i had a typo and was to blind to see it. At least I have no better explanation..

Libre0fficer gravatar imageLibre0fficer ( 2018-02-05 16:10:29 +0100 )edit

If the third argument is 0 it means "use system character encoding" (or actually the process' default encoding) which is UTF-8 if your system uses UTF-8 but something different if not.

erAck gravatar imageerAck ( 2018-02-05 16:28:27 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-02-02 22:12:17 +0100

erAck gravatar image
soffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":44,34,76 myfile.xlsx

where 76 is the number of the UTF-8 encoding (and 44 the comma and 34 the double quote character ASCII value). For details of the filter options see https://wiki.openoffice.org/wiki/Docu...

edit flag offensive delete link more

Comments

This works, thank you very much!

Libre0fficer gravatar imageLibre0fficer ( 2018-02-05 16:12:47 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-02 19:05:09 +0100

Seen: 1,281 times

Last updated: Feb 02 '18