Deleting adjacent empty paragraphs

Creating tables and queries
Post Reply
woopy
Posts: 3
Joined: Sun Jul 23, 2017 2:35 pm

Deleting adjacent empty paragraphs

Post by woopy »

Hi,

\n\n works with line breaks, but $$ doesn't work with paragraph breaks.
I'd like to combine paragraph deletion with something like {} if possible, e.g. ^${2,} would delete two neighbouring empty paragraphs or more but not single empty paragraphs.

Edit: \n{2,} works, ${2,} doesn't.
Last edited by woopy on Sun Jul 23, 2017 5:04 pm, edited 2 times in total.
Libreoffice 5.1.6.2, Linux Mint 18
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Deleting adjacent empty paragraphs

Post by RoryOF »

Don't bother. Simply Find and replace ^$ with nothing two or three times until no more deletions of empty paragraphs are reported.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
woopy
Posts: 3
Joined: Sun Jul 23, 2017 2:35 pm

Re: Deleting adjacent empty paragraphs

Post by woopy »

Thanks for your suggestion but that is not satisfactory in this case.
I have a long document and it's full of unnecessary adjacent empty paragraphs, but I don't want to remove singular empty p., my doc. would look to congested and ugly.
Libreoffice 5.1.6.2, Linux Mint 18
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Deleting adjacent empty paragraphs

Post by RoryOF »

Remove the singular empty paragraphs and change the spacing after paragraph in the paragraph styles definitions to do this automatically.
 Edit: Otherwise you will have to use AltSearch extension, as OO F&R does not search across paragraph boundaries 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
woopy
Posts: 3
Joined: Sun Jul 23, 2017 2:35 pm

Re: Deleting adjacent empty paragraphs

Post by woopy »

That's a nice idea, thanks. Another workaround I've just realized is when I search for ^$ and replace it with something unique, then I delete that thing.
Libreoffice 5.1.6.2, Linux Mint 18
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Deleting adjacent empty paragraphs

Post by RoryOF »

Be aware that by deleting paragraph marks you might increase paragraphs beyond OpenOffice's 64K character limit, which can cause problems.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply