Mobile app version of vmapp.org
Login or Join
Shanna688

: Find unwanted paragraph marks (GREP, find, replace, script) I have an InDesign CS6 document with a lot of numbered paragraphs. They begin with a number and end with a paragraph mark. However,

@Shanna688

Posted in: #AdobeIndesign #Grep #IndesignScripting

I have an InDesign CS6 document with a lot of numbered paragraphs. They begin with a number and end with a paragraph mark. However, there are some paragraphs which have unwanted paragraph marks in the middle.

Question: how do I find these unwanted paragraph marks and remove them?

In other words, I want to remove the extra paragraph mark (highlighted) in this image...




So, in human language I want to say...


If a paragraph has "Paragraph style 1" applied
...and the
paragraph begins with one or more digits
......and those digits
have "Bold character style" applied
.........and then there is a
string of characters which could include footnote markers with
"Footnote reference character style" applied but should not include
any digits with "Bold character style" applied
............and
then a paragraph mark
...............and then another string of
characters which could include footnote references with "Footnote
reference character style" applied but should not include any digits
with "Bold character style" applied
..................and then a
paragraph mark
Then delete the first paragraph mark!


Now, in this particular document I am working on I could get away with not specifying the paragraph and character styles so my first thought was the following GREP expression:

(d+ .+)(r)(.+r)


…which reads: find any digit(s) followed by a space and then a string of characters, then a return, then another string of characters and a return.

Then I could easily replace the three bracketed expressions with just the first and the third.

However, when I conduct a search, for some reason paragraphs with footnote markers are skipped. Also, it does not specify that the text string should not include any digits with "Bold character style" applied.

Any help will be appreciated.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shanna688

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shelley591

Two criteria for your Find:


Use this GREP search: r(?!d)
And specify "Paragraph Style 1" in the Find Format field.




GREP search looks for a paragraph mark r, not followed by a digit (a "negative look ahead") (?!d).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme