[Solved] Find & replace empty paragraphs

Discuss the word processor
Locked
It'sJustMe
Posts: 1
Joined: Fri Jul 23, 2021 5:43 am

[Solved] Find & replace empty paragraphs

Post by It'sJustMe »

I should have been more specific. Sorry about that. I need to find and replace empty paragraphs/paragraph markers.
I have replaced 302 lines of text with a space. Now there is a space where there was a line of text and it is still a paragraph with another empty paragraph after it.
I would like to remove the line that contains only a space and the paragraph marker so I will have one single paragraph marker rather than two empty paragraphs 302 times in my document.

Is it possible to do a "Find and Replace" to remove the extra space and paragraph 302 times? I have done it in other word processing programs but cannot find any information on this task in Apache OpenOffice. Does anybody know if this is possible?

I looked at that https://extensions.openoffice.org/en/pr ... -altsearch site. It states, "Searching for paragraph, character and list style; possibility to choose a style from the menu" but I do not need to change a paragraph style. I need to delete empty paragraphs.

I look forward to any suggestions. Thank you.
----------------

original question - How can I use the find and replace feature to find & replace nonprinting characters? I have done it in other word processing programs so I know it is possible. But I cannot find any information on this task in Apache OpenOffice. Does anybody know?
("nonprinting characters" can be turned on and off under the VIEW heading in the menu or using the icon in the toolbar.)
Last edited by It'sJustMe on Sun Jul 25, 2021 4:43 am, edited 1 time in total.
Apache OpenOffice 4.1.6
Windows 10
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: find & replace nonprinting characters

Post by robleyd »

Using regular expressions in the Find/Replace dialog will probably cover most of your needs. Search the Help - F1 - for regular expressions for more information. If that doesn't help, come back with your specific problem.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: find & replace nonprinting characters

Post by RoryOF »

Click on the Help button on the Find and Replace window, and look at the link for "Regular expressions" on that page for detailed information. To Find and Replace such regular expressions you need to drop the "More options" selection on Find and Replace window, and check "Regular expressions". When finished with your current task, remember to uncheck that setting for ordinary (text) F&R to operate correctly.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: find & replace nonprinting characters

Post by RoryOF »

The most common items one needs to know are these:

^
Only finds the search term if the term is at the beginning of a paragraph. Special objects such as empty fields or character-anchored frames, at the beginning of a paragraph are ignored. Example: "^Peter".

$
Only finds the search term if the term appears at the end of a paragraph. Special objects such as empty fields or character-anchored frames at the end of a paragraph are ignored. Example: "Peter$".

\n
Represents a line break that was inserted with the Shift+Enter key combination. To change a line break into a paragraph break, enter \n in the Search for and Replace with boxes, and then perform a search and replace.
\n in the Search for text box stands for a line break that was inserted with the Shift+Enter key combination.
\n in the Replace with text box stands for a paragraph break that can be entered with the Enter or Return key.

\t
Represents a tab. You can also use this expression in the Replace with box.

And remember you must turn on More options, Regular expressions for these searches to work.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: find & replace nonprinting characters

Post by JeJe »

You may find this extension helpful

https://extensions.openoffice.org/en/pr ... -altsearch
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Mountaineer
Posts: 310
Joined: Sun Sep 06, 2020 8:27 am

Re: find & replace empty paragraphs

Post by Mountaineer »

Try if searching for

Code: Select all

^ $
with option regular expression finds your lines.
If this works, replace all with nothing (empty replace box)

J.
OpenOffice 3.1 on Windows Vista
Locked