[Solved] (for now): Finding tabs and paragraph ends

Discuss the word processor
Post Reply
bfdc
Posts: 6
Joined: Mon Dec 04, 2017 2:48 pm

[Solved] (for now): Finding tabs and paragraph ends

Post by bfdc »

I need to double space between paragraphs of a document that contains parts that are already double-spaced and parts that aren't.

Want to find the paragraph end (\n, right?) and replace it with two returns, or whatever they're called.

OO doesn't find paragraph ends, though they're clearly there, visible with nonprinting characters on.

Regular expressions checked.

OO can find tabs, at least right-pointing ones. And I can replace anything with paragraph returns, and they show up as the backward cap P.

Can us $ for end graph to add the extra return, but...

...After adding all the extra lines, I need to find the triple-spaced spots and replace them with double-spaced.

I feel like I found the \n once, but no longer, and I am not sure what I might have done (very little) to change settings.

If any help on this, great, if not, I'm just going to live with it, I guess because I'm tired of :crazy:

Thanks,
Bob
Last edited by bfdc on Tue Dec 05, 2017 2:35 am, edited 1 time in total.
Think the best of yourself, and those around you. Drink plenty of water.
<><>
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Finding tabs and paragraph ends

Post by acknak »

Greetings and welcome to the community forum!

There are some serious restrictions on what you can do with paragraph breaks (shown as ¶) in Find & Replace.

You can find/replace/add/remove paragraph breaks by
Search for: $
Replace with: \n

That won't actually change anything (replace a break with a break). You can use two (or more) \n in the replace field to add extra breaks.

And you can find/replace an empty paragraph with
Search for: ^$
Replace with: (whatever)

But Writer cannot search across a paragraph break. So you can't search for two breaks in a row.

The best way to manage space between paragraphs is to use the paragraph format: Format > Paragraph > Indents & Spacing > Spacing > Above/Below paragraph, but you may not want to re-work all the spacing to do that.
AOO4/LO5 • Linux • Fedora 23
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Finding tabs and paragraph ends

Post by keme »

acknak wrote:...
The best way to manage space between paragraphs is to use the paragraph format: Format > Paragraph > Indents & Spacing > Spacing > Above/Below paragraph, but you may not want to re-work all the spacing to do that.
Exactly. You can do it anyway...

Step by step:

Save a backup before making major changes...

Change all paragraphs with default style to use "Body text" instead.
  • Menu item Edit - Find and replace
    Click the More options button
    Tick the option to search for styles.
    Select to search for the default style (named "Default" or "Standard", or something similar depending on language settings)
    Replace with "Body text".
    Click button Replace all.
Remove all empty paragraphs.
  • Still using Edit - Find and replace - More options
    Untick styles option
    Tick Regular expressions
    Search for ^$ (two characters, caret + dollar sign)
    Leave the "replace" field empty
    Click button Replace all.
If the spacing is not right, adjust space before or after the "Body text" style.
  • Menu item Format - Styles and formatting
    Right click Text Body and edit
    Select the Indents and spacing tab.
    Set suitable spacing before or after paragraph. 4-5mm is a good starting point for normal size text.
bfdc
Posts: 6
Joined: Mon Dec 04, 2017 2:48 pm

Re: Finding tabs and paragraph ends

Post by bfdc »

Thanks, greatly, fellows. I appreciate the info. These all look and sound like good ideas. At least till somebody decides to make it possible to find paragraph ends, add a line return, find three returns, make them into two returns. (It's the actual returns or line returns or spaces between the lines--whichever you want to call them--that are the necessity as I take them out of the word processor and return them to the text file where they must live.)
<><>
Think the best of yourself, and those around you. Drink plenty of water.
<><>
User avatar
robleyd
Moderator
Posts: 5082
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Solved (for now): Finding tabs and paragraph ends

Post by robleyd »

If these are simple text files, you might find that a text editor will do a better job of find/replace in this particular case; I'm not sure what text editors come with/are available for Mac. However, a quick net search suggests there are many.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Solved (for now): Finding tabs and paragraph ends

Post by keme »

Notepad++ supports regular expressions search/replace, also with matching across newline. Beyond the scope of this forum, but anyway, here goes...
  • Download and install Notepad++
  • Open your file
  • Menu item Search - Replace
  • Enable rule-based search
  • Search for (\s*\n)+
  • Replace with \n\n
bfdc
Posts: 6
Joined: Mon Dec 04, 2017 2:48 pm

Re: Solved (for now): Finding tabs and paragraph ends

Post by bfdc »

Gadzooks! TextEdit, the existing Mac text editing program, allows finding paragraphs and tabs. No macro capability, I think, but as long as all the other repetitive stuff can be handled in AOO, I can do this one thing or two in TextEdit and be pretty darned happy. Thanks for pointing out the Notepad++ capability, which got me thinking about the TextEdit ability, which I had known about, I think, but it had slipped my mind, obviously, till I looked for it. Life is good. :bravo:
Think the best of yourself, and those around you. Drink plenty of water.
<><>
Post Reply