Bug 117955 - CSV file is re-saved with wrong delimter
Summary: CSV file is re-saved with wrong delimter
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.6.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-01 11:48 UTC by Christian Kral
Modified: 2018-06-01 20:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo test CSV file with TAB delimters (24 bytes, text/csv)
2018-06-01 11:49 UTC, Christian Kral
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Kral 2018-06-01 11:48:20 UTC
Description:
I open a CSV file with TAB separated values in LibreOffice Calc and change some cells. The I hit CTRL+S to save the changed file. Then, the CSV file is saved replacing the TAB by a COMMA (,) which cannot be the intention of saving a CSV file which was opened with TAB delimiters. 

If I create a new file and save it as CSV file with TAB delimiter, then any saving of the CSV file (using CTRL+S) does store the file TAB delimiter. This is the expected behavior. 

The actual problem occurs, when LibreOffice Calc is used to open and re-save a TAB separated CSV file. 

Steps to Reproduce:
1. Open CSV file with TAB delimiter
2. Change cells
3. Save file
4. Open CSV file with editor: TAB changed to COMMA (,)

Actual Results:  
TAB is replaced by COMMA

Expected Results:
TAB should not be changed when saving, if a TAB separated CSV file is opened


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Comment 1 Christian Kral 2018-06-01 11:49:41 UTC
Created attachment 142475 [details]
Demo test CSV file with TAB delimters
Comment 2 Jacques Guilleron 2018-06-01 14:33:39 UTC
Hi Christian,

When you opended the CVS document, did you kept only the Tab delimiter in the wizard? It seems that when doing that, when you save it, the Tab delimiter is used?
Do you confirm it?
An other way is, when you save the file xith "Save as", to tick "Edit filter settings". After File format confirming, will appears the "Export Text file Options"
where you can precise the delimiter.
Does it work so?
Comment 3 V Stuart Foote 2018-06-01 14:41:10 UTC
The import dialog will control the output on resave to CSV. Preferentially will use Comma to generate CSV.

If maintaining Tab delimiter, for a round trip edit, clear the Comma delimiter. You'll get the Tab delimiter.
Comment 4 Christian Kral 2018-06-01 20:01:34 UTC
Hi Jaques,

Thanks a lot for your reply. 

>When you opened the CSV document, did you kept only the Tab delimiter in the 
>wizard? It seems that when doing that, when you save it, the Tab delimiter 
>is used?
>Do you confirm it?

So far I always had TAB and COMMA checked when opening a CSV file. So this explains that I thought it is a bug, even though it is a feature. Your are very right: if I uncheck COMMA then Calc behaves as I would expect it. If I save the CSV file then, the original TAB delimiters are kept.

I researched a lot on this issue, before writing this bug report. However, I was not aware of the software behavior based on the checkmarks offered by the import wizard.  

>An other way is, when you save the file xith "Save as", to tick "Edit filter
>settings". After File format confirming, will appears the "Export Text file 
>Options" where you can precise the delimiter.
>Does it work so?

Yes everything works as you explained it. Thanks for clarifying this issue.

Best regards,
Christian