Retaining line breaks when pasting multi-row text form Calc

Hello! In Excel this worked by itself, but I am having this problem ever since moving to LibreOffice.
For example, I have following information set in Calc

  Column  A

Row 1

               Hello!

              My name

               is...

Row 2

             I live...

               in...

Row 3

              My age
           
               is...

Now when I copy a single cell and paste it into a notepad linebreaks are preserved.
eg.

               Hello!

              My name

               is...

When I copy multiple rows at once and paste them… Linebreaks from inside cells are gone
eg.

            Hello! My name is...

             I live... in...

How do I keep the linebreaks when pasting?

1 Like

Did you try Edit > Paste Special > Paste Special > Rich Text Formatting (RTF)?

Hmmm, a kind of workaround:
You can prepare a range in your spreadsheet using the formula =SUBSTITUTE(A1;CHAR(10);CHAR(13)) and respective. Copying this range and pasting it into the plain text editor should do as you want.

(Calc cells use U+000A for internal line breaks.)
And: Line breaks in spreadsheet cells should be avoided. For decades they were not accepted at all.

A good solution was to create another cell with this function:

=CONCATENATE(A1,CHAR(10),CHAR(10),A2,CHAR(10),CHAR(10),A3)

This way the new cell contains collective information from all of the cells and retains the line breaks

To anyone who is struggling with the same issue!

Clever Idea! However, if your version of LibO is 5.4 or higher:

Eveb better use =TEXTJOIN(CHAR(10);1;A1:A3).
It’s simpler to enter / edit and clearer to the eye.

I have exacly this problem.
The proposed solution is not possible for me, as I have hundreds of cells with line-breaks that have to be pasted into another application, and all line-breaks must be there.

There is another solution, that I found in Excel and works in LibreOffice also:

  • Copy all required cells in Calc,
  • and paste them in and empty Writer document. There, the cells are shown as a table.
  • Then select all (the whole Writer-table) and copy
  • then paste into whatever other application.
  • VoilĂ : all text, including the line-breaks.

Please don’t use “Suggest a solution” for your post if there isn’t a solution.

Internal line breaks in Calc cells are mostly evil for many reasons. If you think your case is an exception you would have to describe it in detail to convince me. Just “WYSIWYG” is a bad reason.

To help you with your problem as long as you didn’t update your workflow, I show a possible workaround in the attached example.
disask_47626_demo_including_TextOLE.ods (25.3 KB)

@Lupp,
At first my post was --as you say-- not a solution. But later I edited it because I remembered the Excel situation.
Now it is certainly solution.