Bug 124899 - Exporting CSV with separator " & " exports with no separator
Summary: Exporting CSV with separator " & " exports with no separator
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: CSV-Export
  Show dependency treegraph
Reported: 2019-04-23 10:53 UTC by Ulrich Windl
Modified: 2019-04-24 14:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

Image showing the problem (composed of three screen shots) (171.16 KB, image/png)
2019-04-24 05:59 UTC, Ulrich Windl
ODS Sample file (18.69 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-04-24 07:48 UTC, Ulrich Windl

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2019-04-23 10:53:24 UTC
I had intended to export a table in calc for TeX, so I chose " & " as field separator for CVS export. However the exported data had no separator at all (while there was no warning or error popup)!
When I used "&" as separator, the CVS used that separator.

Steps to Reproduce:
1. Export table as CSV, using " & " as separator

Actual Results:
No separator is being used

Expected Results:
The specified separator is being used

Reproducible: Always

User Profile Reset: No

Additional Info:
Comment 1 m.a.riosv 2019-04-23 13:47:26 UTC
Works for me selecting the separator at saving.
Choosing in the save window after select CSV type 'Edit filter settings', cliking save and on the window settings introducing & as separator.

If in a cell, & works as strings concatenate operator.
="A+"&"B" => "A+B"
Comment 2 V Stuart Foote 2019-04-23 16:19:28 UTC
Can not reproduce on Windows 10 Ent 64-bit en-US with
Version: (x64)
Build ID: 9ba025bafb03b962c34687cf87806cc03a3a7436
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL

Using the dialog via "Edit filter settings" check box allows setting the "&" as the Field delimiter.

=> WFM
Comment 3 Ulrich Windl 2019-04-24 05:59:11 UTC
Created attachment 150965 [details]
Image showing the problem (composed of three screen shots)

I Repeated the procedure described: It seems when "Saving as..." CSV the field separator, while being allowed to be multiple characters, actually just uses the first character entered. For those saying they could not repeat, maybe read exactly what I have done.
Comment 4 m.a.riosv 2019-04-24 07:08:27 UTC
Please attach a sample file whit what you want to save as CSV, and a CSV sample file with what you want to get. With a couple of lines it's enough.
Comment 5 Ulrich Windl 2019-04-24 07:48:32 UTC
Created attachment 150966 [details]
ODS Sample file
Comment 6 Ulrich Windl 2019-04-24 07:52:47 UTC
If not clear from the description, my idea was to have additional spaces around the '&' separator for readability:
Instead of

I'd prefer
h/L & 3.1373 & 5 & 10 & 15 & 20 & 25 & 30 & ... & Max
0 & 0 & 11 & 26 & 39 & 52 & ... & 92
10 & 0 & 10 & 24 & 38 & 50 & ... & 92
Comment 7 V Stuart Foote 2019-04-24 14:24:56 UTC
Oh, sorry. Just realized you actually were asking for a "multi-character" delimiter.

No, unfortunately, we do not implement a multicharacter delimiter, just a single character--and in your example LO was doing as told and using the first character you enter in the Filter Settings dialog--so " " (U+0020) delimited.

I guess there is an issue here is that the filter dialog "allows" you to enter more than 1 character in the field--but it is parsed down to just the first character. 

The filter dialog was made persistent (OOo issue 3687), but can find no discussion of implementing a multicharacter delimiter from the OOo era or for LibreOffice. IMHO such an enhancement is =>WF, otherwise this is NAB.

Personally I would just use the "&" delimiter, and then flush resulting delimited file through sed to add the leading and trailing spaces.