English
Ask Your Question
0

CLI - convert ods to csv with semicolon as delimiter

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

Klau3 gravatar image

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

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

2 answers

Sort by » oldest newest most voted
0

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

oweng gravatar image

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.

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

Comments

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 +0200 )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 +0200 )edit
1

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 +0200 )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 +0200 )edit
0

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

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
Select:
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

Comments

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 +0200 )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 +0200 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

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

Seen: 3,079 times

Last updated: Aug 29 '13