[Solved] Removing hard line breaks from text

Discuss the word processor
Locked
RCL85
Posts: 2
Joined: Tue Feb 04, 2025 2:53 pm

[Solved] Removing hard line breaks from text

Post by RCL85 »

Hello,

I'm working with text imported from an OCRd PDF.

The OCR software has retained the original line breaks, and I need to remove them all so that the text wraps around naturally to the margins. Is there any way I can do this automatically in Writer (rather than manually, which will take a very long time)?

Thanks

2025-01-28 (307).png
2025-01-28 (307).png (39.36 KiB) Viewed 6740 times
Last edited by floris v on Tue Feb 04, 2025 4:52 pm, edited 1 time in total.
Reason: Tagged Solved as per OP's last comment. floris v
OpenOffice 4 on Windows 10
User avatar
LastUnicorn
Posts: 812
Joined: Sat Mar 29, 2008 2:41 am
Location: Scotland

Re: Removing hard line breaks from text

Post by LastUnicorn »

LibreOffice 25.8.4.2 (x64) installed to Windows 11 Pro. 25H2
Apache OpenOffice Portable 4.1.16 [Portable Apps]
For Java I use Adoptium Temurin JRE LTS Releases.
User avatar
floris v
Volunteer
Posts: 4638
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: Removing hard line breaks from text

Post by floris v »

There are a few ways to do that:
1. Use Tools - AutoCorrect - Apply. First tick all options that you want in Tools - AutoCorrect - AutoCorrect Options, Options tab. Scroll down to the bottom, where you will find the most important ones.
2. Use Find/Replace to find all line breaks (\n) and replace them with a space. You have to enable Regular expressions. Downside: this may turn your entire document into a single paragraph.
LibreOffice 25.8.4.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Removing hard line breaks from text

Post by RoryOF »

floris v wrote: Tue Feb 04, 2025 3:31 pm ...
Downside: this may turn your entire document into a single paragraph.
And OpenOffice does not like paragraphs longer than 64K characters. LibreOffice is better for long paragraphs.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
User avatar
LastUnicorn
Posts: 812
Joined: Sat Mar 29, 2008 2:41 am
Location: Scotland

Re: Removing hard line breaks from text

Post by LastUnicorn »

LibreOffice 25.8.4.2 (x64) installed to Windows 11 Pro. 25H2
Apache OpenOffice Portable 4.1.16 [Portable Apps]
For Java I use Adoptium Temurin JRE LTS Releases.
RCL85
Posts: 2
Joined: Tue Feb 04, 2025 2:53 pm

Re: Removing hard line breaks from text

Post by RCL85 »

LastUnicorn wrote: Tue Feb 04, 2025 3:24 pm Does this help: Using Replace to remove line breaks
That worked, thanks!
OpenOffice 4 on Windows 10
Locked