Ask Your Question

in "Find and Replace", how do I replace with NOTHING (deleting empty lines)

asked 2019-09-06 09:11:22 +0100

linuxyz gravatar image

updated 2020-08-16 12:19:25 +0100

Alex Kemp gravatar image


I'd like to remove empty line in LIbreOffice writer.

I search for empty line by putting in "FInd" the regular expression:


But I'd like to delete this detected empty line now.

How can I do it?

I've put nothing into the "Replace" field but it leaves the empty line how it was.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-09-06 09:34:34 +0100

ajlittoz gravatar image

The built-in Find & Replace can operate only within a paragraph content. The paragraph mark, which position (only) is represented by $ is external to paragraph content.

As a consequence, what you do with your regular expression is to erase spacers present in the spacer-only paragraph, getting a truly empty paragraph.

Unless you install the AltSearch extension, the only means to do it "out of the shelf" is to display the formatting marks (View>Formatting Marks) to make visible the effective content of your document (including spaces, tabs, new lines, paragraph marks, …). Then you must hunt manually for empty paragraphs and remove them with Backspace or Del.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

edit flag offensive delete link more


Actually, LibreOffice F&R has two dedicated patterns that may operate on paragraph boundaries themselves. They are ^$ (allows to remove already empty paragraphs), and $ (allows joining all paragraphs together). See this FAQ.

Mike Kaganski gravatar imageMike Kaganski ( 2019-09-06 12:43:55 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-09-06 09:11:22 +0100

Seen: 1,216 times

Last updated: Sep 06 '19