[Solved] Replace paragraph marks with line breaks
[Solved] Replace paragraph marks with line breaks
How can I (in the whole document) replace paragraph marks by manual line breaks?
Last edited by MrProgrammer on Sun Sep 07, 2025 8:39 pm, edited 2 times in total.
Open Office 4.1.15 on Windows 11 Home
Re: Replace paragraph by manual line breaks
Why? What do you wish to achieve?
If you wish to replace line breaks (which show up as a left pointing hooked arrow when /View /Non printing characters is enabled), do this
Find \n
Replace \n
Drop More Options and check Regular Expressions.
Press "Replace all" button
If you wish to replace line breaks (which show up as a left pointing hooked arrow when /View /Non printing characters is enabled), do this
Find \n
Replace \n
Drop More Options and check Regular Expressions.
Press "Replace all" button
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
- Hagar Delest
- Moderator
- Posts: 33482
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Replace paragraph by manual line breaks
Technically, I think that there is still the limitation of 64k characters per paragraph.
Meaning that if your file exceeds this number of characters, then you'll have a problem.
Meaning that if your file exceeds this number of characters, then you'll have a problem.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
Re: Replace paragraph by manual line breaks
Thanks, Hagar; I had forgotten about the OpenOffice 64K paragraph limitation.
But the replacement \n will be Paragraph breaks, not line breaks, so the limitation should not come into play.
But the replacement \n will be Paragraph breaks, not line breaks, so the limitation should not come into play.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
- MrProgrammer
- Moderator
- Posts: 5347
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Replace paragraph by manual line breaks
This seems like a very bad idea. I decline to help people with shooting themselves in the foot. If you proceed with this task I recommend that you save a pre-damaged version of your document, since it seems likely you will want to revert to that after you discover what difficulties have been introduced. Paragraphs are fundamental to Writer. It is impossible to eliminate the final paragraph mark, since text in a document must be contained in a paragraph.
If you were to somehow eliminate all the other paragraph marks in your document, you would turn it into one giant paragraph. There are two problems with that:
• OpenOffice has a limit of 65535 characters per paragraph.
• You will be limited to a single paragraph style, and since some text properties are controlled by the paragraph style (like the text indentation, alignment, line spacing, tab settings, etc.) you will not be able to set those properties independently for different sections of your text. The giant paragraph would assume the settings of the paragraph which was originally first.
Read about styles in Help → Index or in User Guides (PDF) or searching for topics about this in the Writer Forum.
If you can explain your goal and why you want to eliminate all of your paragraph marks, perhaps someone can suggest an alternate path to the goal which does not involve replacing paragraph marks by line breaks. Attach a document demonstrating the situation (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). I will not help further unless you attach. Don't just make an attachment; we also need to know how you want to change the docuent.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Replace paragraph by manual line breaks
If they are actually line breaks, you need to mark the ends of paragraphs by an empty paragraph. Then execute the following sequences:
Find ^$
Replace %%%%
Drop More Options, check Regular expressions.
Press Replace All button
Then
Find \n
Replace <space character>
Press Replace All button
Then
Find %%%%
Replace \n
Press Replace All.
Now all Line Breaks will have been replaced with space characters. Each paragraph will remain as a paragraph, so you ought not run into OpenOffice's 64K paragraph limitation.
You may have a little editing to do, removing a small number of funny hyphenations.
In case of disaster (and it lurks!) best to work on a copy of the file.
Find ^$
Replace %%%%
Drop More Options, check Regular expressions.
Press Replace All button
Then
Find \n
Replace <space character>
Press Replace All button
Then
Find %%%%
Replace \n
Press Replace All.
Now all Line Breaks will have been replaced with space characters. Each paragraph will remain as a paragraph, so you ought not run into OpenOffice's 64K paragraph limitation.
You may have a little editing to do, removing a small number of funny hyphenations.
In case of disaster (and it lurks!) best to work on a copy of the file.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
- Hagar Delest
- Moderator
- Posts: 33482
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Replace paragraph by manual line breaks
Sure, it was just a comment on the initial question.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
-
erbsenzahl
- Volunteer
- Posts: 264
- Joined: Tue Apr 18, 2017 8:23 am
- Location: Germany
Re: Replace paragraph marks by manual line breaks
Should work on LibreOffice and OpenOffice
AltSearch.oxt (latest version 1.5.1.2)
https://extensions.libreoffice.org/en/extensions/show/70066
SEARCH
REPLACE
----------------------------------
Using regular SEARCH&REPLACE
Step 1
Copy a manual line break
Step 2
AltSearch.oxt (latest version 1.5.1.2)
https://extensions.libreoffice.org/en/extensions/show/70066
SEARCH
Code: Select all
\pCode: Select all
\nUsing regular SEARCH&REPLACE
Step 1
Copy a manual line break
Step 2
- Start regular SEARCH&REPLACE
- ☒ regular expressions
- SEARCH ALL
Code: Select all
$ - Leave regular SEARCH&REPLACE - the paragraph marks are still highlighted
- Hit shortcut CTRL + V
- Each highlighted paragraph mark should be replaced by a manual line break
LibreOffice current versions 24.x/25.x and OpenOffice 4.1.15
on LinuxMint 21 - 22 Mate, W10-64 pro
on LinuxMint 21 - 22 Mate, W10-64 pro
Re: Replace paragraph marks by manual line breaks
Maybe the OP is confused about the terminology. He probably has a text with paragraph breaks at the end of every line, and he wants to get rid of them. Then we have the classical situation. Note that he hasn't been back since posting.
LibreOffice 24.2.7.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
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
- Hagar Delest
- Moderator
- Posts: 33482
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Replace paragraph marks by manual line breaks
Nice guess indeed!
It would make perfect sense.
It would make perfect sense.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
- MrProgrammer
- Moderator
- Posts: 5347
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Replace paragraph marks by manual line breaks
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Replace paragraph marks by manual line breaks
I want to do this because I have found that certain email applications do weird things with paragraph markings ... like turning them into double line spaces. New-line works better.
Some comments:
(1) \n in one place means something different from \n in another place? Sound like bad programming to me.
(2) Microsoft Word does this with no trouble at all: Replace ^p by ^l. Yes, the final ^p is never replaced.
(3) What I did: Created a message in Open Office Text. Saved it as a Word .doc file. Used Word to change ^p to ^l.
(4) New Windows 11 machine. My old Word works only half way. No longer at ease in the new dispensation.
Some comments:
(1) \n in one place means something different from \n in another place? Sound like bad programming to me.
(2) Microsoft Word does this with no trouble at all: Replace ^p by ^l. Yes, the final ^p is never replaced.
(3) What I did: Created a message in Open Office Text. Saved it as a Word .doc file. Used Word to change ^p to ^l.
(4) New Windows 11 machine. My old Word works only half way. No longer at ease in the new dispensation.
Open Office 4.1.15 on Windows 11 Home
Re: Replace paragraph marks by manual line breaks
That explains a lot. It would have been better if you had added your reasons for doing this in your first post.
Re your (1): I'm with you. (2): While Word doesn't squeak if you do that in a well formatted document, you will lose much of the formatting if you do that.
You can install the AltSearch extension. That allows you to find and replace across paragraphs, and to replace \p with \n, where \n represents a line break.
Re your (1): I'm with you. (2): While Word doesn't squeak if you do that in a well formatted document, you will lose much of the formatting if you do that.
You can install the AltSearch extension. That allows you to find and replace across paragraphs, and to replace \p with \n, where \n represents a line break.
LibreOffice 24.2.7.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
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
Re: Replace paragraph marks by manual line breaks
I'd use Altsearch as well.
If formatting doesn't matter there is another cumbersome way by saving the document as a Text Encoded file which gives you the choice of LF (line feed) as the paragraph break character. You can then close and open the saved file choosing LF again.
If formatting doesn't matter there is another cumbersome way by saving the document as a Text Encoded file which gives you the choice of LF (line feed) as the paragraph break character. You can then close and open the saved file choosing LF again.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Replace paragraph marks by manual line breaks
There are also text editors like Notepad++ which allow you to do the conversion or to edit as a document with the LF as the paragraph character.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Replace paragraph marks by manual line breaks
Thank you Floris. That works.
Open Office 4.1.15 on Windows 11 Home