Highlighted

search and replace paragraph return affects following paragraph

Explorer ,
Jul 11, 2020

Copy link to clipboard

Copied

I'm using  global search and replace to clean up  huge lsits of data. I have added specail cahracters to defien headings and  subheadings but sometiems teh data field is  empty - so I am left with  a comma followed by a  hard return [paragraph]

I'd like to search a nd replace  the following , ^p with just ^p. But when I do that it affects teh following paragraph and cahnges its style to the style of the one I'm workign on. How to get around that? this behavior is both for GREP and  text find/change. See the comma after  "Laboratoire"

notannhavoc_0-1594513126597.png

see how the enrty for culture has changed

notannhavoc_1-1594513298066.png

 

 

Adobe Community Professional
Correct answer by Barb Binder | Adobe Community Professional

Alternatively, just use a regular expression (GREP) that specifies only a comma that appears at the end of a paragraph:
,$

 

~Barb

 

grep.gif

TOPICS
How to

Views

77

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

search and replace paragraph return affects following paragraph

Explorer ,
Jul 11, 2020

Copy link to clipboard

Copied

I'm using  global search and replace to clean up  huge lsits of data. I have added specail cahracters to defien headings and  subheadings but sometiems teh data field is  empty - so I am left with  a comma followed by a  hard return [paragraph]

I'd like to search a nd replace  the following , ^p with just ^p. But when I do that it affects teh following paragraph and cahnges its style to the style of the one I'm workign on. How to get around that? this behavior is both for GREP and  text find/change. See the comma after  "Laboratoire"

notannhavoc_0-1594513126597.png

see how the enrty for culture has changed

notannhavoc_1-1594513298066.png

 

 

Adobe Community Professional
Correct answer by Barb Binder | Adobe Community Professional

Alternatively, just use a regular expression (GREP) that specifies only a comma that appears at the end of a paragraph:
,$

 

~Barb

 

grep.gif

TOPICS
How to

Views

78

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 11, 2020 0
Most Valuable Participant ,
Jul 13, 2020

Copy link to clipboard

Copied

Remove a paragraph return -> the following characters will now be a part of the first paragraph (with the same format as the previous first paragraph!). Insert a new paragraph sign -> the format remains.

Why you do not use a positive lookahead instead?

Find what:

(,\h)(?=\r)

Change to:

[nothing (leave this field blank)]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 13, 2020 0
Explorer ,
Jul 19, 2020

Copy link to clipboard

Copied

that works - thank you and it enabled me to expand the search to  address other characters - just wish I knew what it meant

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 19, 2020 0
Adobe Community Professional ,
Jul 13, 2020

Copy link to clipboard

Copied

Alternatively, just use a regular expression (GREP) that specifies only a comma that appears at the end of a paragraph:
,$

 

~Barb

 

grep.gif

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 13, 2020 1
Explorer ,
Jul 19, 2020

Copy link to clipboard

Copied

that is great, I didn't realize I could leave the replace field blank. why the dollar sign??

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 19, 2020 0
Adobe Community Professional ,
Jul 19, 2020

Copy link to clipboard

Copied

The dollar sign is a location metacharacter for End of Paragraph, which is a fancy way of saying find all text in the Find field that is located at the end of a paragraph, but do not include any other characters beyond that, such as the paragraph return.

So the comma must appear as the last character in the paragraph, and only the comma will be replaced, not the paragraph return. Your original Find/Replace strings included the paragraph return character, which is why it was changing the paragraph style as well.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 19, 2020 2