Bug 156171 - Add option for Line Feed in text-to-columns / CSV import
Summary: Add option for Line Feed in text-to-columns / CSV import
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CSV-Dialog
  Show dependency treegraph
 
Reported: 2023-07-05 16:15 UTC by Silvio
Modified: 2023-07-14 09:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
SAMPLE CALC SHEET FOR BUG REPRODUCTION (42.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-07-05 16:15 UTC, Silvio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Silvio 2023-07-05 16:15:45 UTC
Created attachment 188221 [details]
SAMPLE CALC SHEET FOR BUG REPRODUCTION

I report a defect in LibreOffice Calc, in the Text-To-Columns function. I have a set of data in a column that when submitted to the text-to-columns function, spliting the text only by the "/" character, the final block of data occupies more lines than the original block, probably because there was some LF-CR character in some cell of the original block. I understand that even if there is this character, the final block should have strictly the same number of lines as the original block. Because in a situation where I have two columns in the original block, the lines of the final block will be shifted and broken.
Comment 1 Mike Kaganski 2023-07-05 18:58:42 UTC
In tdf#155948, the request was the opposite:

> Given a columnar range, allow the application of Text Import on the text in
> those cells, separated by newlines; with the result placed in the (infinite?)
> range beginning at the top-start cell of the range.
Comment 2 Silvio 2023-07-05 19:58:10 UTC
Well, as you can see in the example file provided, when your dataset has 2 or more columns, only one column gains more rows, and that breaks the correspondence between data of different columns.
Comment 3 Mike Kaganski 2023-07-05 20:34:59 UTC
The point is: there are contradicting requirements; the current way it functions is not "defective" by itself; so an option should be considered, not an unconditional change how it works.
Comment 4 ady 2023-07-06 10:56:24 UTC
(In reply to Silvio from comment #0)
> probably because there was
> some LF-CR character in some cell of the original block.

In attachment 188221 [details], there are cells with [CTRL]+[ENTER] within some of the cells (e.g. B95).

This means that the UNICODE 10 (line feed) character is included in some cells, generating the row "offset".

A workaround would be (before using the Text-to-Columns feature) to use the Find and Replace dialog to replace (by nothing) the LF character, probably using some Regular Expression. This alternative is less user-friendly.

The behavior described in comment 0 is already present in OOo.

Considering comment 3 > needsUXEval.
Comment 5 Heiko Tietze 2023-07-14 09:30:31 UTC
How about adding an option whether or not the #10 LF char should be considered?

UI wise I'd add it after "Space" using the term "Line Break" and move "Other" into the next line.