Insert a newline character to cell

Hi

So I have 20k lines, that look similar to this one
1801 104-208 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 1802 1-208 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 1821 53-60, 64-66, 71-102, 104-105, 107-108, 110-120, 122, 129-130, 154, 165-167, 169-172, 179-180, 184, 186-190, 193-200, 203 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 1822 1-2, 4-15, 22-30, 33-36, 45-46, 49-52, 76, 86-102, 104-141, 143-148, 151-158, 160-182, 186-196, 198-205 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 1823 42-47 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten

It’s plain text, one line. I figured out proper regex phrases and used sed to change it to:

(1801) 104-208 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 
(1802) 1-208 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 
(1821) 53-60, 64-66, 71-102, 104-105, 107-108, 110-120, 122, 129-130, 154, 165-167, 169-172, 179-180, 184, 186-190, 193-200, 203 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 
(1822) 1-2, 4-15, 22-30, 33-36, 45-46, 49-52, 76, 86-102, 104-141, 143-148, 151-158, 160-182, 186-196, 198-205 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten 
(1823) 42-47 Dod. niesamoistny: Beilage zu No... des Hamb. unpartheyischen Correspondenten

(multiline plain text)

The trouble is that it is supposed to be in one, multiline cell, but I can’t seem to figure out how to move that to calc. One cell is simple, but how do I do 20k? Calc has no way of knowing that I want to contain those in one cell.

Is there some special character I can use to let calc know what I want to do i.e replace my newline from sed with something like \n \r\n (I tried, doesn’t work).

Thank you
Adam

Calc is an arithmetic calculation program, just an ordinary spreadsheet. A simplified arithmetic programming language for non-programmers. You should use some programming language for text processing such as Perl or Python. You mentioned sed.

I figured out that part. The problem is moving results to calc.

Create a CSV from your data, and open in Calc. Using the proper CSV syntax for multiline cells, you may do what you need.

1 Like

Valid csv with multi-line strings require double or single quoting. Quotes within quoted strings are doubled.
Double-quoted multi-line text with double-quotes:

"First Line CRLF Second CRLF Quote: ""To be or not to be"" CRLF Fourth Line"

The outer double-quotes mark one string, the inner double double-quotes mark double-quotes within the string.

1 Like

That (quoting cells) did it, thank you.