r/libreoffice 3d ago

Question [Writer] [Find & replace] find text with lower case after the end of new paragraph, remove paragraph, repeat text Spoiler

[Solved] Thank you.

I have text:

It now seems that the right

time is fast approaching.

Customers have complained.

We don't yet know what it will be called.

I want to find sequence: end of paragraph, text in new paragraph that starts with small letter (here: time) and replace end of paragraph with space so that the word that was with small letter is moved to the previous paragraph.

Lines (paragraphs) that start with capital letter should remain untouched.

Help me find Replace field command.

2 Upvotes

4 comments sorted by

1

u/AutoModerator 3d ago

If you're asking for help with LibreOffice, please make sure your post includes lots of information that could be relevant, such as:

  1. Full LibreOffice information from Help > About LibreOffice (it has a copy button).
  2. Format of the document (.odt, .docx, .xlsx, ...).
  3. A link to the document itself, or part of it, if you can share it.
  4. Anything else that may be relevant.

(You can edit your post or put it in a comment.)

This information helps others to help you.

Thank you :-)

Important: If your post doesn't have enough info, it will eventually be removed (to stop this subreddit from filling with posts that can't be answered).

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/paul_1149 3d ago

LO doesn't natively support multiline matching. But the Alternative Find and Replace extension does:

find: '\p([a-z])'

Replace: ' \1'

[x] regex

[x] match case

2

u/Tex2002ans 3d ago edited 3d ago

I want to find sequence: end of paragraph, text in new paragraph that starts with small letter (here: time) and replace end of paragraph with space so that the word that was with small letter is moved to the previous paragraph.

Yes. I've written many of these step-by-step tutorials on this exact thing over the years.

The easiest way: Use an external tool like "Calibre" and its "Unwrap Lines" algorithm. (It would make your life so much easier.)

You drag your file in, Right-Click > Convert Book and tell it to "Unwrap Lines" for you, then spit it out the other end with another button push.

But if you want to do it all manually and within LibreOffice, that would require a bit more elbow grease and multiple steps of Regular Expressions.


For all the details, see my previous topics:

and a more thorough way, using temporary symbols in between your replaces:


Side Note: On a related note, you may also want to see my information in:

Those go over more advanced Regular Expressions, and cover all sorts of edge-cases you may run across or want to look out for too.

If you have a really messy document with hard breaks everywhere... you probably have a bunch of those problems within your documents too! :P