Ask Your Question

CLI - convert ods to csv with semicolon as delimiter

asked 2013-08-28 20:54:16 +0100

Klau3 gravatar image

updated 2014-02-19 23:01:50 +0100

manj_k gravatar image

I would like to know how to convert a spreadsheet .ods file to a semicolon separated .csv file using the command line.

That's what I got so fare ↓ but couldn't find any information about how to set the delimiter.

soffice --headless --convert-to csv test.ods
unoconv -e FilterOptions=59,34,0,1,1/5/2/1/3/1/4/1 -f csv test.ods

... a comma separated csv file is nearly useless.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2013-08-29 04:53:20 +0100

oweng gravatar image

updated 2014-10-26 02:41:46 +0100

There is no way to set the delimiter using soffice from the CLI. There does not appear to be a parameter to handle the CSV delimiter and the File > Save As... menu option (when choosing CSV) always reverts to using a comma under v4.1.0.4. I am not sure about unoconv, however given that it is merely a front-end to soffice I would doubt it offers any option either. it appears from another answer that the FilterOptions argument can be used effectively. Bug fdo#36313 also describes an enhancement (coming in v4.4) to the infilter argument that may assist in handling.

Please file an enhancement bug and provide as much information about this new feature as possible. The component is likely "filters and storage". Don't forget to mark your bug as an 'enhancement'. The QA team will be happy to help you triage your feature request in the bugtracker. Please post a link to any bugs you file in a comment below using the format "fdo#123456". Thanks!

edit flag offensive delete link more


Unoconv should allow the user to set the delimiter, but there seems to be a bug #161 (first number of the FilterOptions is the delimiter number in hex).

Klau3 ( 2013-08-29 10:54:39 +0100 )edit

Ah, OK. Thus the "59" (decimal of the Unicode value for semi-colon) in your example. Thanks for reporting back.

oweng ( 2013-08-30 02:07:46 +0100 )edit

Here is the LO bug #68786. I couldn't find the "filters and storage" category in spreadsheet so I selected 'FILTER'. Also I have no clue on how to mark it as enhancement bug. Lets see what the dev's think about it.

Klau3 ( 2013-08-31 12:53:42 +0100 )edit

Thanks. I have confirmed it and set the Severity to enhancement (you can't do this via the BSA).

oweng ( 2013-08-31 15:01:47 +0100 )edit

answered 2014-10-16 11:34:46 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

unoconv -f csv -e FilterOptions="59,34,0,1" test.ods

Works fine! tested using Mac OSX 10.10

edit flag offensive delete link more

answered 2013-08-29 07:39:25 +0100

ROSt52 gravatar image

if you don't stick to the conversion using the command line you can do the following:

Have your ods-file open
Save As > Text CSV (.csv) > Save
click: Use Text CSV Format
Character set: you need to select what suits your usage of the CSV file (I am using UFT-8)
Field delimiter: select >semicolon<
Text limiter: select what you need ( I keep it at >"<)
Check what you need for your application among the following next 4 checkboxes ( check only the first item)
Click: OK

In the same way you can create csv-file with comma, semicolon, colon, tab, and space as field delimiter and choose other elements needed for an application requiring a special csv-file format.

edit flag offensive delete link more


Doing stuff with the command line allows automatisation and thats the reason why I don't want to use the UI.

Klau3 ( 2013-08-29 10:47:03 +0100 )edit

I am aware that the command line is / might be faster, I never used it. I just wanted to give you a workaround

ROSt52 ( 2013-08-29 12:51:22 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2013-08-28 20:54:16 +0100

Seen: 4,321 times

Last updated: Oct 26 '14