Skip navigation
Currently Being Moderated

Replace three blank lines with one smaller one

Feb 21, 2013 8:21 AM

Hi

 

I have an Indesign document which is populated from a database. A lot of the data imports with four paragraph breaks between lines (i.e. three empty lines).

 

I can easily substitute ⩑P⩑P⩑P⩑P with ⩑P⩑P which reduces the spacing between actual lines to one blank line, but what I really want to do is make the remaining blank line smaller, as though it were a paragraph style with space after. I can't use para styles as this messes up the import and character styles, which I do use, don't allow for space after.

 

Is there any way using find and replace to automate this, please?

 

Thanks in advance for any help.

 
Replies
  • Currently Being Moderated
    Feb 21, 2013 11:48 PM   in reply to tim-p

    You should not use blank paragraphes at all. To use multiple returns (your case) and multiple normal spaces (not special ones) in a row are a typographicaly a no-go.

    Set up a paragraph style with space before and after.

    To remove you can use find and replace there is a preset in the GREP section to remove trailing spaces which will clean up your file after import from other applications.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 22, 2013 1:44 AM   in reply to tim-p

    tim-p wrote:

     

    I have an Indesign document which is populated from a database. A lot of the data imports with four paragraph breaks between lines (i.e. three empty lines).

     

    I can easily substitute ⩑P⩑P⩑P⩑P with ⩑P⩑P which reduces the spacing between actual lines to one blank line, but what I really want to do is make the remaining blank line smaller, as though it were a paragraph style with space after.

     

    It's tricky to use the regular find-and-change with paragraph returns, because it may mess up paragraph styles; and in your case, you want some of the attributes the blank line to change, but the 'other' paragraph return is going to end up tacked on to the end of your last paragraph, so that should not change anything.

     

    You can use a GREP find-and-change instead, which circumvents the Accidental Change Syndrome ... by not finding that "previous return"!

    Search for this:

     

    (?<=\r)\r{3}

     

    and replace with this:

     

    \r

     

    This will replace three hard returns in a row (and also preceded by at least one) with a single hard return. To make this blank line smaller, you can change its Leading value in the Change To Formatting (so first find out what value you want it to be). This new leading is also applied to just the single new hard return, not to the hard return at the end of the previous line.

     

    tim-p wrote: ... ⩑P⩑P⩑P⩑P ...

     

    That made me scratch my noodle for a while. "Logical-Not with Dot Above"? Those are usually a plain '^'

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 24, 2013 4:22 AM   in reply to tim-p

    You COULD fix it properly by first searching for \r(?=\r{3}) and adding the space after to that, then searching for (?<=\r)\r{3} and replacing with nothing, I think. If you prefer space before, you could could search for (?<=\r{4}) before removing the three blank paragraphs.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 24, 2013 4:24 AM   in reply to Peter Spier

    Sorry left off the . in the second expression. that should have been search for (?<=\r{4}). to find the find the first cahtacter of the paragraph following the three blank lines (the fourth return is the one on the non-blank paragraph before the three blanks) and add the space before.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points