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
If I copy/paste the file.csv content into libre office calc, it is correctly one line.
cannot reproduce with delimiter , (comma) and quotechar " (double quote)
Created attachment 205884 [details] screenshot after import
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
please attach test csv file. Thank you.
No repro with a recent LO Dev 26.8 on Windows.
Created attachment 205891 [details] CSV with \n Created on linux with codium (shows two lines).
(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.
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
(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.
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
(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.