Bug Hunting Session
Bug 68786 - FILTER: headless – delimiter option missing when exporting from ods to csv
Summary: FILTER: headless – delimiter option missing when exporting from ods to csv
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.2.2 release
Hardware: Other Linux (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.3.2 target:4.4.0
Keywords:
Depends on: 89739
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-31 10:46 UTC by Thibaut
Modified: 2015-02-28 19:18 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaut 2013-08-31 10:46:47 UTC
Problem description:
Currently it is not possible to set the file or text delimiter when converting a .ods file to .csv using 'soffice –headless' on the command line. The current default file delimiter is a comma. Comma is a common punctuation mark and therefor as file delimiter nearly useless when doing some computation after file conversion to csv with external tools (line length will variate if the input .ods file includes a cell with a comma).

In OpenOffice there is be pretty complicated way to set the delimiter on the command line, so I guess the feature exists in LO too, but is currently not exposed to the user: http://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options


Design suggestion how to implement the delimiter feature:
Add three new commands to the command line interface.

--calc-delimiter-file
Sets the calc file delimiter

--calc-delimiter-text
Sets the calc text delimiter

--printstd
Prints the output of any command to std out -> Would allow to process the output further with other tools.

I've filled a unoconv bug too: https://github.com/dagwieers/unoconv/issues/161

Plus, please update the command line help text to include some more information, some examples and links to web resources.
Operating System: Ubuntu
Version: 4.0.2.2 release
Comment 1 Owen Genat (retired) 2013-08-31 13:00:42 UTC
I can confirm this bug. Setting status to NEW and Severity to enhancement. Currently it is not possible under Crunchbang 11 running TDF/LO v4.1.0.4 to set the delimiter of the CSV file to be exported.
Comment 2 Mikeyy - L10n HR 2015-02-28 12:05:46 UTC
As I answered here:
http://ask.libreoffice.org/en/question/21916/cli-convert-ods-to-csv-with-semicolon-as-delimiter/?answer=46463#post-id-46463

There is a way to set delimiter:
soffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":"59,ANSI,1" test.ods

There is also a way to set text delimiter, got it from this openoffice forum thread:
https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=75404

It should look like this, but I didn't test it:
soffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":"59,34,ANSI,1" test.ods

You should test it and report if it works.

Problem is, there is no documentation of any kind for this.
Comment 3 V Stuart Foote 2015-02-28 19:18:45 UTC
Beleive this was also resolved by Tomas Hlavaty's work on bug 36313 -  CLI: Encoding issue when Converting documents: esp. UTF-8 in headless mode

http://cgit.freedesktop.org/libreoffice/core/commit/?id=45ba4d79d968f81f74ef0c4588fd15b1ce91153f

Documentation for CLI needs attention -- bug 89739