Bug 171106 - Importing CSV with newline "\n" - preview doesn't refresh STR comment 10
Summary: Importing CSV with newline "\n" - preview doesn't refresh STR comment 10
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2026-03-02 08:46 UTC by Marcel
Modified: 2026-03-03 10:45 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot after import (9.22 KB, image/png)
2026-03-02 10:51 UTC, Werner Tietz
Details
Screenshot csv file (51.80 KB, image/png)
2026-03-02 12:46 UTC, Marcel
Details
CSV with \n (45 bytes, text/csv)
2026-03-02 19:49 UTC, Marcel
Details
CSV with \n preview broken (52.25 KB, image/png)
2026-03-03 07:37 UTC, Marcel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel 2026-03-02 08:46:05 UTC
LibreOffice 26.2.0.3

I have this file.csv, in correct RFC 4180 format, which contains a newline \n in the second cell

```
firstcell,"second
cell has newline",thirdcell
```

the result are two lines in libreoffice calc instead of one
Comment 1 Marcel 2026-03-02 08:49:43 UTC
If I copy/paste the file.csv content into libre office calc, it is correctly one line.
Comment 2 Werner Tietz 2026-03-02 10:50:25 UTC
cannot reproduce with delimiter , (comma) and quotechar " (double quote)
Comment 3 Werner Tietz 2026-03-02 10:51:41 UTC
Created attachment 205884 [details]
screenshot after import
Comment 4 Marcel 2026-03-02 12:46:25 UTC
Created attachment 205886 [details]
Screenshot csv file

hexdump file.csv (contains 0a new line)
0000000 6966 7372 6374 6c65 2c6c 7322 6365 6e6f
0000010 0a64 6563 6c6c 6820 7361 6e20 7765 696c
0000020 656e 2c22 6874 7269 6364 6c65 006c     
000002d


more file.csv 
firstcell,"second
cell has newline",thirdcell
Comment 5 raal 2026-03-02 16:55:37 UTC
please attach test csv file. Thank you.
Comment 6 ady 2026-03-02 16:58:40 UTC
No repro with a recent LO Dev 26.8 on Windows.
Comment 7 Marcel 2026-03-02 19:49:53 UTC
Created attachment 205891 [details]
CSV with \n

Created on linux with codium (shows two lines).
Comment 8 raal 2026-03-02 20:03:48 UTC
(In reply to Marcel from comment #7)
> Created attachment 205891 [details]
> CSV with \n
> 
> Created on linux with codium (shows two lines).

Select String delimiter:"
it's imported in one row then.
Comment 9 Marcel 2026-03-03 07:37:53 UTC
Created attachment 205897 [details]
CSV with \n preview broken

You are right, adding the 'String delimiter: "' fixes it.

It didn't follow this path as the preview is broken when choosing it (see attachment).

After the first import, when performing the second csv import (where " is preselected) the preview is correct.

So it is only a preview bug when changing the 'String delimiter:' select box.

Thank you for everything, and I'm sorry for my initial assumptions
Marcel
Comment 10 raal 2026-03-03 08:31:57 UTC
(In reply to Marcel from comment #9)
> 
> After the first import, when performing the second csv import (where " is
> preselected) the preview is correct.
> 
> So it is only a preview bug when changing the 'String delimiter:' select box.
> 

I can confirm with Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: a8ae0abbd646443a65dc2e5f44c395fb5a454a29
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

Steps to reproduce:
import file.csv and delete String delimiter in the Text import dialog. Preview and import in the Calc are two rows.
Close Calc and import again. Calc remember old settings, so String delimiter is empty.
In the preview are two rows. It's correct.
Set String delimiter to "
Now the preview is incorrect, it's still two rows, but imported is only one row.

It's a regression. In LO 7.3.7 when I change String delimiter from " to empty and vice versa, preview refresh correctly.
Comment 11 raal 2026-03-03 08:56:20 UTC
This seems to have begun at the below commit in bibisect repository/OS linux-64-25.2.
Adding Cc: to Gabriel Masei ; Could you possibly take a look at this one?
Thanks
 1163f394d9cb0cfb4289f7ec814fbf7f82fa8774 is the first bad commit
commit 1163f394d9cb0cfb4289f7ec814fbf7f82fa8774
Author: Jenkins Build User <tdf@maggie.tdf>
Date:   Wed Oct 9 15:39:36 2024 +0200

    source 565b619d57a3b98b0826c4b49dee6606f9ae70e0

165905: tdf#160582 Preserve settings saving in csv import dialog | https://gerrit.libreoffice.org/c/core/+/165905
Comment 12 ady 2026-03-03 10:45:28 UTC
(In reply to raal from comment #10)

> It's a regression. In LO 7.3.7 when I change String delimiter from " to
> empty and vice versa, preview refresh correctly.

Just to be clear and avoid potential confusion, the bug is about how the preview might show the import under specific circumstances; the actual import is always correct.