Hi
Firstly apologies if this has been posted elsewhere - I tried searching first.
I have a calc spreadsheet with two to three columns of data. The first column has one line per cell, however the second and third columns have cells with both only one line of text, and multiple lines of text in each cell. I would like to rearrange the data in cells that have multiple lines of text to all be on the same line. As my original document has over 5,000 rows, doing this individually is not practical.
I have uploaded a picture of a dummy spreadsheet with an example of what the data looks like on the left, and how I would like it to be on the right.
I would appreciate any help. Thank you.
[Solved] Convert multi-line data in cell to single line
[Solved] Convert multi-line data in cell to single line
- Attachments
-
- workspace_manual_234532_as.png (97.79 KiB) Viewed 2516 times
Last edited by Analise01 on Wed Aug 20, 2025 9:10 am, edited 1 time in total.
Windows 11, Open Office 4.1.7
Re: Rearranging multiple lines of data inside same cells in same column
Hallo
use ⇒ Find and replace:
search:
[x]regular Expression
⇒⇒ replace all
use ⇒ Find and replace:
search:
Code: Select all
# search for
\n
#replace:
<literal space>⇒⇒ replace all
Last edited by karolus on Sat Aug 16, 2025 7:28 pm, edited 1 time in total.
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Re: Rearranging multiple lines of data inside same cells in same column
Try this on a copy of your document.
Open the Find & Replace dialog using the menu Edit -> Find & Replace.
In the Search For box, enter \n
In the Replace With box enter a space character
Click More Options and select the box labeled Regular Expressions
Optional - Click the Find All button an check that the cells you expect to change are selected
Click Replace All.
If that doesn't work for you, please upload a sample file, not an image, and explain what was wrong with the result of the above steps.
Open the Find & Replace dialog using the menu Edit -> Find & Replace.
In the Search For box, enter \n
In the Replace With box enter a space character
Click More Options and select the box labeled Regular Expressions
Optional - Click the Find All button an check that the cells you expect to change are selected
Click Replace All.
If that doesn't work for you, please upload a sample file, not an image, and explain what was wrong with the result of the above steps.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Rearranging multiple lines of data inside same cells in same column
My two cents:
1. Don't use whitespace again to separate the former lines. Use a visible separator like "/" for the purpose.
2. You can also create a second sheet, and there use a formula like
filled right and down to as many columns/rows as you need. The formula will adapt as needed due to the relative addressing.
CHAR(10) is the whitespace character used in Calc cells for "go to new line".
1. Don't use whitespace again to separate the former lines. Use a visible separator like "/" for the purpose.
2. You can also create a second sheet, and there use a formula like
Code: Select all
=SUBSTITUTE(A1; CHAR(10); "/")CHAR(10) is the whitespace character used in Calc cells for "go to new line".
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Rearranging multiple lines of data inside same cells in same column
Hi everyone, apologies for the late reply. Thank you all for your help - this has now worked on my document.
Windows 11, Open Office 4.1.7