Search and Replace Tools

I have previously used the Alternative Find & Replace extension, but I’m receiving an error that a number of other users have received (screenshot attached). Their questions/tickets indicate that no resolution has been found and the developer has not responded to email or questions. I’ve reinstalled the extension multiple times. (I’m running Version: 6.2.5.2 (x64) on OS Windows 10, and the AltSearch extension is 1.4.2.)

What are the other options available for searching for formatting codes in a Writer file? For example, I need to locate any occurrence of “space paragraph return paragraph return” and replace that with a single paragraph return. This would be fairly straightforward in MS Word ( ^p^p → ^p). I’ve tried searching by $, but it doesn’t seem that symbol can be used in conjunction with other symbols, like to only find a paragraph return when preceded by a space.

Is there another recommended extension or different codes that can be used as regular expressions in Search/Replace? Thank you.

(edited on 2021-01-02 by ajlittoz to display the screenshot)

Hopefully you wouldn’t use a chainsaw without having read the important parts of the manual.

Concerning AltSearch and its usage of Regular Expressions:
\p searches for a paragraph break.
\p+ searches for a sequence of paragraph breaks.
Replacing \p+ with \p does it (in a clever way without needing to look for pairs of paragraph breaks again and again.

I’m afraid that AltSearch wasn’t working at all (see the error message screenshot attached) and isn’t an option for search and replace, but I would be very interested to know if anyone has a solution for that Basic Runtime Error (it has been reinstalled multiple times but still won’t run). Perhaps the answer is in my missing chainsaw manual. :slight_smile:

@DraftWorks

Hi,
there is the offline help system, search for regular expressions – list of for the regular SEARCH&REPLACE tool.

You could find ^$ Finds an empty paragraph. Search and replace with nothing.
Then search for {1}$ which finds exactly one tailing space at the paragraph’s end. (You may probably look for a better choice like \s{1}$, if necessary.)
So you could replace space | paragraph return | paragraph return with paragraph return ´- in two steps.

But this method may not be specific for your purposes, probably you only wanted to find the desired combination of “values”. Knowing this I hesitated giving an answer to your question…

  • For more information check…

Documentation/How Tos/Regular Expressions in Writer - Apache OpenOffice Wiki (also descripted rare “unexpected results”)
and

We have moved - ICU - International Components for Unicode (sorry, was not available at that moment)
and

other addresses given in the above mentioned wiki website.

EDITED

And the truth about AltSearch.oxt is that it does not always exactly work under all circumstances.
But AltSearch.oxt could do - in a restricted proceeding (single step method).

Search for \s{1}\p^$ and replace with… \p - but only single replacing! (Replace all does not sufficiently work in this case.) So you have a lot of single steps, maybe it’s too cumbersome for you. But it could work…

If Word does better, so use it. Hopefully LibreOffice will reach that standard in future ;-). - Cheers

@Grantler

Thank you – I greatly appreciate the information. It’s good to see an approach to search&replace that could get at at least part of what I’m trying to correct. Your suspicion was correct that, because of other formatting in the document, I would need to find and replace only that precise combination of values all in one fell swoop, but those codes and steps will be very helpful with other situations. I’ve enjoyed working in LO as a basic word processing package, but it’s certainly capable of a lot more, even if I need to briefly step outside it. Thank you!

No answers and I was under a deadline, so I took the file to a computer that had MS Word and resolved the issue in less than five minutes. This issue is something that comes up a lot for me, so I think I need to set up regular access to MS Word instead of relying only on LO.

Do not answer your own question unless it is a real answer.

So I’m clear going forward, must a solution to a problem only involve resources found within LO?