Bug 167609 - Single cell in a spreadsheet linked to CSV replaces comma with null
Summary: Single cell in a spreadsheet linked to CSV replaces comma with null
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.2.4.3 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-External-Datalink
  Show dependency treegraph
 
Reported: 2025-07-20 23:33 UTC by Ken Sharp
Modified: 2025-07-21 17:43 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Minimal .ods (11.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-07-21 14:36 UTC, Ken Sharp
Details
CSV file (18 bytes, text/csv)
2025-07-21 14:37 UTC, Ken Sharp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Sharp 2025-07-20 23:33:02 UTC
Description:
I have a spreadsheet that links to a number of CSV files which are generated automatically.

In every case except for one cell the CSV is correctly detected as a CSV. Even the same CSV in another cell appears to be detected correctly.

If I remove the link and recreate it, the CSV is correctly detected and the relevant cell is inserted into my spreadsheet. If I save and re-open it, however, the cell always reverts to the whole line from the CSV, comma included.

There is nothing special about this CSV. It is in the same format and encoding as all the others.

I had to pull apart my .ods to find the answer.

<table:table-source xlink:type="simple" xlink:href="/some/path/ThisWorks.csv" table:table-name="ThisWorks" table:filter-name="Text - txt - csv (StarCalc)" table:filter-options="44,34,76,1,,0,false,true,true,false,false,0,false,false,true" table:mode="copy-results-only"/>

<table:table-source xlink:type="simple" xlink:href="/some/path/ThisDoesNotWork.csv" table:table-name="ThisDoesNotWork" table:filter-name="Text - txt - csv (StarCalc)" table:filter-options="0,34,76,1,,0,false,true,true,false,false,0,false,false,true" table:mode="copy-results-only"/>

The working cell, and all the working cells, have the first option set to 44 (comma), but for some reason Calc keeps setting the broken cell to 0 (null). Null isn't even an option in the CSV importer dialog. I don't know where it got this idea from.

I installed the latest pre-release, 25.8.0, to see if it was fixed but it wasn't.

Manually editing the XML and sticking it all back together solved this for me (I've kept a backup of the broken one).

Steps to Reproduce:
1. Link CSV
2. Save
3. Re-open

Actual Results:
The whole CSV is imported as... text?

Expected Results:
The CSV is treated as a CSV and the cells are parsed correctly.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 25.2.4.3 (X86_64) / LibreOffice Community
Build ID: 33e196637044ead23f5c3226cde09b47731f7e27
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: CL threaded
Comment 1 fpy 2025-07-21 13:55:38 UTC
could you attach minimal .ods and .csv to reproduce the problem ?
Comment 2 Ken Sharp 2025-07-21 14:36:16 UTC
Created attachment 201921 [details]
Minimal .ods

Hopefully this is small enough. I'm not sure how to make it smaller without snipping bits of XML out.

On loading it correctly shows the value (£13) that it saved from initially linking to the .csv, but allowing the links to be updated causes the issue.
Comment 3 Ken Sharp 2025-07-21 14:37:50 UTC
Created attachment 201922 [details]
CSV file

I didn't want to mess with the path that the .ods uses, so I pick up this .csv from /tmp/shares/

Hopefully this all makes sense.
Comment 4 fpy 2025-07-21 17:43:32 UTC
cannot reproduce on a new .ods, linking the .csv.
it's parsed correctly and remains correct on refresh
(using 24.8.7.2)

also on your example, I suspect  "the same CSV in another cell ..." is a false positive cause B1 is 0.
if you put 1 on the .csv, in won't appear correctly in the cell  minimal.J1.