Find/Change single "end of paragraph" breaks but not double?

Learn / Forums / General InDesign Topics / Find/Change single "end of paragraph" breaks but not double?

Viewing 4 reply threads
  • Author
    Posts
    • #92279

      Hi, everyone.

      New to the forums and InDesign and seeking wise council. :) I searched for the the answer to my question, but had no luck.

      I have a text in InDesign that has a lot of “end of paragraph” breaks randomly throughout the paragraphs. My paragraphs are broken up. I want to delete those and replace them with spaces. However, at the end of the paragraphs, there are two “end of paragraph” breaks. Every time I do a grep find/change \r to space, it picks up the double “end of paragraph breaks” and messes up the formatting more. ARrrgh. Any ideas?

      To illustrate what I mean, included is an example of my problem… where the “(\r)” refers to the “end of paragraph” breaks:

      Pangloss enseignait la métaphysico-théologo-cosmolonigologie. Il(\r)
      prouvait admirablement qu’il n’y a point d’effet sans cause, et(\r)
      que, dans ce meilleur des mondes possibles, le château de(\r)
      monseigneur le baron était le plus beau des châteaux, et madame(\r)
      la meilleure des baronnes possibles.(\r)
      (\r)
      Pangloss enseignait la métaphysico-théologo-cosmolonigologie. Il(\r)
      prouvait admirablement qu’il n’y a point d’effet sans cause, et(\r)
      que, dans ce meilleur des mondes possibles, le château de(\r)
      monseigneur le baron était le plus beau des châteaux, et madame(\r)
      la meilleure des baronnes possibles.(\r)
      (\r)

      The two paragraphs above are the same, but this is for illustrative purposes only to show that the problem continues similarly. I would like to replace the single (\r)s at the end of the lines with spaces, but ignore the (\r)s between the natural paragraphs. Any idea?

      Thank you!

    • #92281

      Find \b\r and replace to \r will take care of all of the artificial breaks within the paragraph, but not the natural paragraphs. That code, however, will not take care of artificial breaks following punctuation like commas, semicolons, etc. Any help?

    • #92282
      David Blatner
      Keymaster

      You probably want to do something similar to this:
      https://creativepro.com/merging-paragraphs-with-findchange.php

    • #92283

      Hi Jeremy,

      if you want to have real control, I would try it this way:

      1.
      Find what: (?<!~b)~b(?!~b)
      Change to: \x20

      2.
      Find what: \x20{2,}
      Change to: nothing

      3.
      Find what: ^~b
      Change to: nothing

      Some explanation: It’s always good practice to have an overview. So there are several steps needed. First remove those unwanted returns (1). Since \r will also find pagebreaks, use ~b instead. So the first one will find a return, that is not preceeded or followed by a return. Since you cannot guarantee, that there is a space already or not, insert a space and remove double space if needed (2). I assume, that you apply a para style with space after. So remove the empty return (3)

      Kai

    • #92288

      Very helpful, friends. Thank you.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
>