LibreOffice 24.2.7.2 on Linux Mint. UK keyboard.
The most common solution to this is Find and Replace >Regular expression $ to \n or \r.
Finds the para break (pilcrow) but doesn’t replace it with. In fact it does nothing.
Tried copying and pasting the line feed. With Uppercase-Enter just comes up with \n. The para break is removed and replaced with “\n”. Just typing \n doesn’t work.
What do I use for the replace box?
You surely mean \p in Find and \n in Replace.
The current version which I just tested disregards Current selection only in this case on Replace all. You need to do it one by one therefore.
Yes, I have tried that too.
This works only when using the extension AltSearch.
To use that extension was suggested by @KamilLanda
Yes, sorry I misunderstood. Altsearch apparently doesn’t work for this function.
Unforrtunate. I also was unable to get Altsearch to do this.
@KamilLanda gave the link to the download page of the extension.
I hadn’t used AltSearch for a long time and had removed it. Now I got it from there, installed it, and it worked as described: One by one in the given case, but much faster than with manual selection.
Anyway you should take very serious what @ajlittoz is posting. Very experienced with Writer , imo.
Functional for me in AltSearch, but there are \. references for regex instead of $.
Find: (a)
Replace: \1\p
checked: Regular expressions
ran Replace all
Yes the AltSearch woprks ok. The issue is there is apparently no way to search for a Paragraph Break.
But there is!
in search box type \p and in replace box type \n
If others confirm this I can mark as solved.
It works only with Altsearch
If you want to retain “proper” paragraph breaks, don’t use Replace All. Just use Replace for each line until you come to a proper paragraph break then press Find and you will move to next paragraph break.
(About the usage of AltSearch for the task:)
You surely mean
... in search box type \p (with backslash) and in replace box type \n ...
Yes indeed. Typo.
I spoke too soon. That works most of the time but not always. I’ve no idea why.
Standard Edit>Find & Replace operates only within a paragraph (with one exception).
When you enter $ in the search box, you designate a position (containing no character), not a range. Therefore you’ll replace nothing, just adding something.
Built-in help (the Help button in the dialog) tells that \n regular expression is a line break in the search box and a paragraph break in the replace box. As a consequence, you try to replace a paragraph break with a paragraph break. This is idempotent.
The standard Find & Replace offers no means to insert a line break through the replace mechanism.
What you can do is to press Find Next button, switch to the document window (keeping the selection) and enter Shift+Enter. Go back the the Find & Replace window for next paragraph break.
But, you’ll be quite as fast by selecting yourself the paragraph break and overtyping a line break. Paragraph breaks are made visible by View>Formatting Marks.
Note also that semantically anf formatting-wise, paragraph and line breaks are not at all equivalent. And even when your document is made of a single paragraph “type” (thus a single style), you’ll create a performance issue because Writer collects the whole paragraph data before starting to render it. Hence, if your paragraph spans several pages, be prepared for slow behaviour.
Yes, that’s how I’ve been doing it. Quite tedious in long document. Many writers don’t know about Shift-Enter, and` use para breaks for line spacing.
This is wrong: a paragraph is supposed to contain meaningful data. An empty paragraph has none. But it is still a paragraph and is managed by the usual text flow. When you edit your text, these empty paragraphs will move according to reflow. They can kill your careful layout.
The correct (and reliable, predictable, safe) wayof handling vertical spacing is through the Spacing parameters (above and below) in the paragraph style configuration dialog. These spacings are automatically ignored at top and bottom of page (unless you explicitly request to keep them).
Space above and below, just like at left and right, are intrinsic attributes of paragraph semantics (a part of your discourse, topic, a comment, a note, …)…
If your goal is to eliminate empty paragraphs, use Edit>Find & Replace with search regular expression ^$ and void replace string. This is the sole exception where the function acts on paragraph extended range including the paragraph break.
In case your idea was to replace empty paragraphs by line breaks in the preceding one, this is also a bad idea. You should instead set spacing below in the paragraph properties.
No, that was not my idea, but it is useful to know.
Many documents I am asked to re-format use instead of <Shift+Enter> for line spacing. Apparently the only way to do it is by manually changing each incident.
No. If you abstracted enough your document, you found that your paragraphs in fact belong in very few distinct semantic categories (main topic, heading, comment, note, …). All paragraph in a category end up formatted the same. Create a user paragraph style for each or customise a corresponding built-one. Apply the style.
This will spare you a lot of work.
My previous project was abandoned. As you pointed out it was a complete mess of incorrect formatting.
The present issue arose mainly because so many documents have paragraph breaks where they should have had line breaks. The writers may not be aware of the difference - maybe they used WordStar ! As far as I recall Wordstar didn’t have paragraph formatting or styles.
Many documents have been scanned from printed material. Perhaps the OCR software puts paragraph breaks for new line.
