Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index

Den 24 mars 2012 13:11 skrev Dan Lewis <>:
On Sat, 2012-03-24 at 11:01 +0000, Brian Barker wrote:
At 09:24 24/03/2012 +0000, E. Letter wrote:
On a separate issue, what is the syntax in LO to
select paragraph breaks (pilcrow (¶) sign) in
the 'find and replace' dialogue window?

There isn't one.  LibreOffice doesn't think that
way: you don't search for the paragraph break as
such.  Instead, you do what you need using ^
(circumflex) to lock your search term to the
beginning of a paragraph or $ (dollar) to lock it
to the end of a paragraph.  Perversely, you can
search for a line break (as entered with
Shift+Enter) using \n (backslash-en).  Oh, but if
you use \n in a "Replace with" expression, it means a paragraph break instead.

I trust this helps.

Brian Barker

    See if this works using Find and Replace with Regular Expressions
checked (ticked):
1) Enter ^$ into the Search for box.
2) Enter " zzz " (space then zzz then space) in the Replaced with box.
3) Click the Replace All button. This replaces the second paragraph
  used for spacing between paragraphs.
4) Enter $ into the Search for box.
5) Enter a space in the Replaced with box.
6) Click the Replace All button.
7) Enter " zzz " in the Search for box.
8) Enter \n in the Replaced with box.
9) Click the Replaced All button.
    The first three steps replaces the empty paragraphs used for
spacing with the word "zzz" (space before and after the zzz allows a
later search for it). The middle three steps replaces the rest of the
paragraph breaks used as line breaks with a space. (This guarantees a
space between the last word of one line and the first word of the next
line.) The last three steps replaces the word "zzz" with a paragraph
    One more search might need to be made: replace any double spaces
with a single space.


I wrote a simple macro (just a draft, feel free to modify it in
anyway) that does it all. It's based on Dan's post above:

REM  *****  BASIC  *****

Sub Main
        Dim sFind As String, sReplace As String

        SearchAndReplace(sFind, sReplace)
        sReplace=" "
        SearchAndReplace(sFind, sReplace)
        SearchAndReplace(sFind, sReplace)
        sFind="  "
        sReplace=" "
        SearchAndReplace(sFind, sReplace)

        sFind="^ "
        SearchAndReplace(sFind, sReplace)

        sFind=" $"
        SearchAndReplace(sFind, sReplace)
End Sub

Sub SearchAndReplace(a As String, b As String)
        Dim Descriptor As Object
        With Descriptor
        End With
End Sub

For unsubscribe instructions e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.