Bug 152332 - [FILESAVE] tab delimited .txt and .tsv files are overwritten as comma delimited by default
Summary: [FILESAVE] tab delimited .txt and .tsv files are overwritten as comma delimit...
Status: RESOLVED DUPLICATE of bug 152336
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-01 02:38 UTC by James Leader
Modified: 2022-12-01 08:43 UTC (History)
0 users

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 James Leader 2022-12-01 02:38:21 UTC
Description:
Opening a tsv file (.tsv or .txt) that is tab delimited and then clicking save will erase the formatting of the file and overwrite as a comma delimited file by default.

A quick google shows this issue has been present in 2015
https://ask.libreoffice.org/t/calc-saving-my-tsv-file-as-a-csv-without-asking/19709

There is a work around: needing to use additional clicks to save as a .csv with "edit filter settings" checked, then selecting field delimiter: "tab", and finally renaming the file to the original file extension.
https://ask.libreoffice.org/t/how-to-generate-calc-tab-delimited-output/14591

Following this procedure to export the file correctly once seems to solve the issue for subsequent saves of all files.



Steps to Reproduce:
1. Fresh install of Linux Mint 21.0
2. Open a .txt file that is tab delimited
3. Click the save icon
4. Re-open the file in a text editor to show that the formatting has been changed to comma delimited
5. Reproducible until "save as" with filter 1 time

Actual Results:
Formatting was changed from tab to comma delimited (file extension still .txt)

Expected Results:
Formatting should be preserved as tab delimited


Reproducible: Always


User Profile Reset: No

Additional Info:
Once doing an export with filter set to tab delimited once, the issue appears to be solved.
Comment 1 Mike Kaganski 2022-12-01 07:26:39 UTC
What field separators are checked when you open the TSV? If you do not change the defaults, three of them (tab/comma/semicolon) are checked, and then application does not know which of those are actually expected in the file (the filter settings are stored with the opened document); when saved, it would use one of the selected separators, which happens to be the comma.

Does this happen when you only check tab on import?

(Tested that it works OK here using both 7.3.0.3 and 7.4.3.2, when tab is the only selected separator.)
Comment 2 James Leader 2022-12-01 08:16:44 UTC
Thanks Mike, that explains it - I had left all 3 checked by default thinking that it would automatically mark it as tabs when found.

Selecting only tab separated as you have suggested solves the overwrite issue.

It would be nice to see automatic detection of tab separated format as a feature (i.e. like MS Excel).
Comment 3 Mike Kaganski 2022-12-01 08:43:16 UTC
Let me then mark your issue as a duplicate for bug 152336, which I have just created specifically for that task. Thanks!

*** This bug has been marked as a duplicate of bug 152336 ***