How to search and replace paragraph breaks?

Id like to be able to search+replace paragraph breaks. Here is a photo of the problem.


Id add another photo but new users arent allowed to. I’m trying to make the text flow smoothly where there is no break between “Jelly” and “Bean”. Ive been manually fixing this problem, but with hundreds to thousands of pages per week, it gets old.

I’m grateful for any advice. I’m also curious as to whether you can search for both a paragraph break AND punctuation. e.g., search for an exclamation point followed by a paragraph break – all in one search, not multiple searches.

Generally, it is better to add a sample file than a screenshot, click up-pointing icon (tooltip Upload) to upload a file.

Click Edit > Find and Replace. In the dialogue:

  • Tick the box Regular Expressions
  • In Find enter $, see List of Regular Expressions
  • in Replace enter a space
  • click Find Next button and click Replace button if found return needs replacing. If all need replacing then click Replace All

To find end of sentence marks with a view to restoring them as paragraphs later use a token that isn’t in the text, e.g. ①

  • In Find enter (!|\?|.)$
  • In Replace enter $1①
  • Replace all paragraphs with a space as above
  • In Find enter (circled 1followed by space)
  • In Replace enter \n

This does not work.

… and are you ready to provide evidence (upload a file)?

The attached screenshot shows that there are numerous paragraph breaks, that “Regular expressions” is selected but the “$” key is not found. Is this because the paragraph breaks are in a table? Does LibreOffice use paragraph breaks as cell delimiters?

@glaudeman
You don’t have any paragraph breaks in the cells, just paragraphs.

If you have at least two paragraphs in a cell, there will also be a paragraph break.

1 Like

That doesn’t make any sense especially since when the table is converted to text, it has paragraph breaks after each cell’s contents. So there are paragraph symbols for/in each cell but they can’t be found/replaced? Although they appear, the paragraph breaks don’t actually exist until the table is converted to text?

When you create a new document, you see a paragraph mark.
Each cell in a text table is a complex structure. It consists of paragraphs, can contain nested text tables, and so on. It seems logical to me that Writer displays a paragraph mark in each cell.


Converting a table to text is not done by replacing paragraph symbols, but through
Menu / Table / Convert / Table To Text

2 Likes