[Solved] Find and Replace paragraphs

Discuss the word processor
Post Reply
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

[Solved] Find and Replace paragraphs

Post by rp2784 »

I've looked and looked all over for this and can't find it. I am looking to find two Paragraph returns and replace them with one. How do you do it? What is the Character Expression for Paragraphs?
Last edited by rp2784 on Wed Jun 13, 2018 1:58 pm, edited 2 times in total.
OpenOffice 4.1.15 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Find and Replace paragraphs

Post by RoryOF »

Use Find and Replace. In Find put ^$, in Replace put nothing, drop more options and check "Regular expressions", then press Replace all.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

Re: Find and Replace paragraphs

Post by rp2784 »

Solved. Thanks!
Last edited by rp2784 on Wed Jun 13, 2018 12:47 pm, edited 1 time in total.
OpenOffice 4.1.15 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Find and Replace paragraphs

Post by RoryOF »

Note that the procedure I outline above removes only blank paragraphs. If the paragraph has any character in it, even a single space, then the procedure I outline will not remove it. When doing this type of reformatting it can be helpful to turn on /View /Non printing characters to see exactly what is the content of paragraphs intended to be removed.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

Re: [Solved] Find and Replace paragraphs

Post by rp2784 »

Well it isn't solved. I went to delete the extra spaces, in a test and nothing happened. I copy and past into Writer from the web and that process has lots of extra returns in it. I just want to do a simple Find and Delete of the extra paragraphs.

1
2

3a

4

5
OpenOffice 4.1.15 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Find and Replace paragraphs

Post by RoryOF »

Turn on /View /non printing characters; you will see that some blank lines have no Pilcrow (Backwards P) at the end. Adjust the Indents and Spacing tab on those paragraph styles to have zero "Space after paragraph".
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

Re: [Solved] Find and Replace paragraphs

Post by rp2784 »

Sorry still not working. I understand about the non printing characters. The test I did was just a quick new page all from the the default setting of writer. No indent, Space after or before, I even selected the text and "cleared formatting" on the text. Still didn't find it.

In Microsoft Word and Adobe InDesign you can "copy" the non printing character and or type /p. I've tried copying from the manual, this string the ^$. nothing happens. It did work once and I thought the problem was solved.
OpenOffice 4.1.15 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Find and Replace paragraphs

Post by RoryOF »

On Find and Replace, did you drop "More options" and check "Regular Expressions"?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

Re: [Solved] Find and Replace paragraphs

Post by rp2784 »

Yes. Let me make sure we are talking about the same thing. I copy and paste Guitar lyrics and chords from a website. I paste that text as "Paste Special" "Unformatted Text". In so doing this process put extra "Paragraph" returns in. So the text has a "row of lyrics" "Paragraph return" "Paragraph return". Then "row of lyrics" "Paragraph return" "Paragraph return". I want to get rid of the extra "Paragraph return".
OpenOffice 4.1.15 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Find and Replace paragraphs

Post by RoryOF »

A small uploaded sample file would help.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

Re: [Solved] Find and Replace paragraphs

Post by rp2784 »

Extra Pargraph test.odt
odt document
(12.19 KiB) Downloaded 212 times
Here is a sample
OpenOffice 4.1.15 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Find and Replace paragraphs

Post by RoryOF »

Find ^$, Replace <nothing>, More options: Regular expressions checked, "Replace all" worked for me on the file as downloaded. It did not work on the " D" and other non-blank paragraphs (/View /non printing characters to see their content).
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
rp2784
Posts: 19
Joined: Mon Jun 11, 2018 8:51 pm

Re: [Solved] Find and Replace paragraphs

Post by rp2784 »

The key stroke [shift][6} does not work. If I copy and past the the [^$], from your initial response, it works correctly. I don't know what the Character Map is for the ^ is.
OpenOffice 4.1.15 on Windows 10
Post Reply