Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP to search all end of paragraph without a full stop and add it automatically

Tagged: ,

Return to Member Forum

  • Author
    Posts
    • #14395941
      Andrea
      Member

      I’m working on a huge book layout in Indesign, but the person who entered the text in a Word document many times forgot to close a paragraph with a full stop.

      I’m not experienced in GREP, but I guess there’s a way to identify only the end of paragraphs where the full stop is missing and add it.
      I tried a GREP expression I found in a similar topic, but it doesn’t work for me, I don’t know why because I’m very basic in GREP.

      Can someone suggest the correct way to achieve this? Get ONLY the paragraphs without a full stop at the end.. and add it.

      Thank you so much.
      Andrea

    • #14395960
      Dhafir Photo
      Participant

      Use this, with Change/Find, not with Change All
      in Find: [^.!?:~e]$(?!)
      in Change: $0.

      • #14395971
        Andrea
        Member

        Thank you for answering.

        I tried what you suggested, this add the full stop but does not find only the target paragraphs (with missing full stops). It also finds empty paragraph signs and paragraphs where the full stop exists. (?)

        I think something should be adjusted in the Find string…

      • #14395972
        Steve Davis
        Participant

        I tried this on dummy text and it worked fantastically — with ‘change-all’ as well, I’m curious why you say not to use it.

      • #14395975
        Andrea
        Member

        Hi Steve,

        yes with simple one paragraph style text it works but not so well with a more complicated text (normal, titles, subtitles, bullets)

        – I cannot use Change all because it picks up even the empty paragraphs, adding a dot. (I cleaned up most of them from the original text, but in some cases they need to stay there)
        – A full stop is added even to titles and subtitles.

        If I search step by step using this GREP, it stops to any end of paragraph symbols (including those with full stop), so it’s not very useful as it is, probably something should be changed to work flawlessly in my document.

      • #14395977
        Dhafir Photo
        Participant

        In this case you should say “find every sentence doesn’t end with a dot”. So try this:
        in Find: \u[^.]+?(?=\u)
        in Change: $0.

      • #14396013
        Andrea
        Member

        Thank you so much for your suggestions,

        I tried with the above GREP but it does not work, it finds some portions of sencences within my document in the middle of a paragraph, not even in the end of the sentence… still not what I would need…

    • #14396017

      Basically:

      F: [^.\r]$
      R: $0.

      (^/) The Jedi

    • #14396018

      … You could exclude some paras as Titles searching their style and applying a condition.

      After that, always basically:

      F: [^.\r]$ + no condition
      R: $0.

      (trash the condition after use.)

      (^/)

    • #14396033
      Peter Kahrel
      Participant

      Did you check whether there are any paragraphs that end in a space (or more spaces even)? If there are any they would trip up the solutions suggested above. To delete any trailing spaces, use this query:

      Find: +$
      Replace with: <leave empty>

      And for sport here’s yet another query to find paragraphs that don’t end in a period and insert a period:

      Find: (?<!\.)$
      Replace with: .

      • #14396036

        Hi Peter,

        (?<!\.)$ will find empty paras inside text and at the end of a story!

        (^/)

      • #14396053
        Andrea
        Member

        Thank you to all for your suggestions. Many missing full stops have been added correctly through the queries and where it was not working 100% I added them manually (there were not so many left).

        Thank you Peter for your first suggestion, I actually had lots of single empty space before the paragraph symbol, and I believe that’s why nothing else was working.

    • #14396037
      Peter Kahrel
      Participant

      Bad sport!

Viewing 5 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads