We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

I am trying to replace the paragraph characters with line break, can't figure it out. Doesn't have option for paragraph break, or does it, or i can't figure that out either. [closed]

asked 2015-08-04 16:53:10 +0200

msearfoss69 gravatar image

updated 2021-05-31 18:55:31 +0200

Alex Kemp gravatar image

Have most recent version, 4.4.5 Using English, writer. I just downloaded this two days ago.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2021-05-31 22:49:10.905183

2 Answers

Sort by » oldest newest most voted

answered 2015-08-04 21:07:23 +0200

pierre-yves samyn gravatar image

updated 2021-05-31 20:45:37 +0200

Lupp gravatar image


This is possible without macro:

  • Type a new line (Shift+Enter) in the (a) document, copy it
  • Edit Find & Replace
  • Search for: $
  • Other options check Regular expressions
  • Click Find All (all paragraph marks selected), keep the selection, close the dialog
  • Edit Paste, that's it...

it is also possible to use AltSearch extension proposes many other possibility.

(Bump only. @Lupp )

edit flag offensive delete link more


Thanks for your answer, it works for me. And indeed, the AltSearch extension works as well: \p matches a new paragraph and \n is a newline character. BTW, the URL of the AltSearchextension has changed: https://extensions.libreoffice.org/ex...

user4657 gravatar imageuser4657 ( 2018-04-24 16:27:17 +0200 )edit

This old answer is still valid. The actions described by @pierre-ives samyn do the trick without relying on an extension or on a macro.

The mentioned extension AltSearch ("Alternative Find&Replace") obviosusly isn't fully maintained any longer and got its last update concerning LibO V, But if you have it installed its replacement string accepts \n actually meaning a hard line break. AltSearch uses \p for a paragraph break.

Lupp gravatar imageLupp ( 2021-05-31 20:44:42 +0200 )edit

answered 2015-08-04 20:33:14 +0200

Alex Kemp gravatar image

As best as I can tell, this can only be achieved with a macro due to an LO RE bug. Possible Macro help here (not accessible when I tried it). You can replace a Line-Break with a Paragraph, but not the other way around. Possible extension fix here.

If you are trying to do this via a macro:

  • Paragraph character (¶): U+000D CR Carriage Return (0x0013)
    (entered at keyboard with Enter key or Return key)
  • Line-Break character (↲): U+000A LF Line Feed (0x00010)
    (entered at keyboard with Shift+Enter key or Shift+Return key)

By menu (cannot work):

  • (menu):Edit|Find & Replace... (Ctrl+H)
    now select Other options then Regular expressions

This is not quite as straightforward as it may seem to those experienced with RE due to LO/OO quirks. The RE help says:-

$ on its own matches the end of a paragraph. This way it is possible to search and replace paragraph breaks.

However, if:-

Find: $
Replace: \n

Nothing happens on Replace all! (it just replaces a Pilcrow ¶ with another ¶). Here is why:-

LO Help on "\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.

What the Help does NOT say (and needs to say) is that, in general, RE cannot be used in the Replace box. Jeez, but that is annoying.

If helps then please tick the answer (✔).

edit flag offensive delete link more


This is super helpful. And confusing also. Thanks!

iamkaant gravatar imageiamkaant ( 2020-05-27 16:17:06 +0200 )edit

Question Tools



Asked: 2015-08-04 16:53:10 +0200

Seen: 7,298 times

Last updated: May 31