Find and Replace tips?

Contributor ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

I have a long catalog document that I've done a complicated data merge with. I have some blank entries that I'd like to find and replace to get rid of quickly. However, I'm finding that I can't figure out how to use find and replace to get rid of these items. I'm trying to get rid of the empty Product Code lines in the attached image. I've tried a bunch of things, but can't seem to get Indesign to recognise anything but "product code" which isn't helpful. In the image I sent, it looks like I could type, "Product Code: (end of paragraph symbol), (standard carraige return), (tab), (end of paragraph), Product Code:, (end of paragraph), (end of paragraph)." I don't remember what the little codes are that indesign uses for these. I've just been selecting these options in the "@" drop-down menu. I've tried various combinations of these, but nothing works. Maybe I just don't know what these symbols mean? Help? 🥺

TOPICS
How to , Type

Views

161

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 04, 2022 Jul 04, 2022

Hi @sarahpeller ,

you said: "I just want to get these 5 empty lines condensed down into one empty line. Does that make sense?"

Maybe, maybe not. "Empty line" or "empty paragraph", two different things, do not make much sense. If you want to get rid of every empty paragraph you'd do that with GREP Find/Change.

 

GREP Find pattern, find an end pf paragraph character after the beginning of a paragraph.

^\r

Replace with nothing.

 

Leaving one empty paragraph is not wise (perhaps I'm wrong, because I

...

Likes

Translate

Translate
Adobe Community Professional ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

Hi @sarahpeller,

Try the following

Find What: 

(Product Code:.*\r)(\h|\x{2063}|\r)*

Change To: $1

P.S.:- I assumed that the unicode for the special space character in your 3rd line is 2063 if it is a different character, replace the required unicode in the grep.

-Manan

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
community guidelines
Contributor ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

I am trying to get rid of these following lines:

 

sarahpeller_0-1656956242550.png

 

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
community guidelines
Adobe Community Professional ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

IMHO, the two blue "colons" can be found neither with Grep nor with Script. They can only be found with the text search.

<FEFF><FEFF>

 

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
community guidelines
Adobe Community Professional ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

I don’t know if this is technically a bug, but I have found there is no way to search for empty fields after a data merge. I have reported it as a bug. You may vote for it below. More votes brings it to the attention of programmers.

https://indesign.uservoice.com/forums/601180-adobe-indesign-bugs/suggestions/38246149-empty-merge-fi...

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
community guidelines
Contributor ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

Thanks. I added to your report

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
community guidelines
Adobe Community Professional ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

Hi @sarahpeller ,

@pixxxelschubser is right! You are looking for <FEFF> special characters.

GREP will not see them. Remove them using TEXT Find/Change. But be aware, that <FEFF> special characters have various purposes. To remove them can be tricky. See this:

FEFF-Text-SearchReplace-WithNothing.png

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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
community guidelines
Contributor ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

I think maybe @Laubender might be onto something here... But I am so sorry. I really can't understand the image file that you attached. I am able to type <FEFF> into the Text find/replace search bar, but I don't know what else to type in order to get rid of these lines:

 

sarahpeller_0-1656956183529.png

 

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
community guidelines
Contributor ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

Ok, I managed to get rid of the empty product code lines with lots of trial and error and frustration... But now I'm left with a bunch of empty lines that I can't get rid of easily.

 

sarahpeller_0-1656957791937.png

 

They look like paragraph symbols, so I've tried using 'end of paragraph' or 'standard carraige return' but I can't get anything to work... I just want to get these 5 empty lines condensed down into one empty line. Does that make sense? It seems this shouldn't be so hard...

 

 

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
community guidelines
Adobe Community Professional ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

Have you already tried Grep search and replace

~b~b+

replace with

\r

 

------------------------------------------------------------------------------------------------------------------

Why you doesn't upload an example indd/idml one-page document (with no confidental data) for testing on a hoster of your choice and link to here?

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
community guidelines
Contributor ,
Jul 05, 2022 Jul 05, 2022

Copy link to clipboard

Copied

Yes, I've tried this one, but it can't accomplish what I need 😕

 

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
community guidelines
Adobe Community Professional ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

Hi @sarahpeller ,

you said: "I just want to get these 5 empty lines condensed down into one empty line. Does that make sense?"

Maybe, maybe not. "Empty line" or "empty paragraph", two different things, do not make much sense. If you want to get rid of every empty paragraph you'd do that with GREP Find/Change.

 

GREP Find pattern, find an end pf paragraph character after the beginning of a paragraph.

^\r

Replace with nothing.

 

Leaving one empty paragraph is not wise (perhaps I'm wrong, because I do not know your layout and data).

If you need distance (vertical whitespace) between two paragraphs, usually it's better to look into Space Above or Space Below of a paragraph. Values you can define easily with a custom paragraph style.

 

FWIW: I wonder, if you need that term "Product Code:" at all, if there is no value assigned to it.

 

To get rid of "empty" paragraphs, if "empty" means also horizontal white space, you could do this with GREP Find:

^\h*\r

Replace with nothing.

 

All this after you have removed the <FEFF> special characters.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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
community guidelines
Adobe Community Professional ,
Jul 04, 2022 Jul 04, 2022

Copy link to clipboard

Copied

Just try one of the greps from me or from @Laubender. But I agree with Laubender: it would be more effective to avoid these unnecessary lines already when creating the data merge instead of tediously removing them afterwards.

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
community guidelines
Contributor ,
Jul 05, 2022 Jul 05, 2022

Copy link to clipboard

Copied

Hey, that's a good idea, @pixxxelschubser! I created a 2-page version packaged file, so you can mess with it yourself.

 

Here's again an example of what I don't want:

 

sarahpeller_2-1657042758493.png

 

 

And an example of how I want the file to look in the end:

 

sarahpeller_1-1657042736739.png

 

And to respond to you comment about avoiding unnecessary lines.... The reasons some of these empty product code lines are in there is because some of the herbs have 3 products, so there are 3 columns in my spreadsheet to account for this. But some have 1 or 2 products, which leaves empty product lines in some of the herbs listed. I couldn't figure out any other way to enter the data other than this way...

 

@Laubender - I tried the 2 codes that you sent and they did find matches in the file, but they only matched to 1 line of emptiness. What I need is to replace all 5 lines at once with 1 blank line. I'm sorry, but I don't have the words to correctly express myself. I'm not sure how to name a blank line... I tried adding your codes twice in a row, but that didn't find a match. The characters that are making up those 5 lines of blank space are complex and I can't figure out what they are made up of... Going through and manually deleting all of them will take a really long time 😞

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
community guidelines
Adobe Community Professional ,
Jul 05, 2022 Jul 05, 2022

Copy link to clipboard

Copied

LATEST

Thank you for the sample file. Unfortunately, the font is only for MacOS and I work under Windows. But that only affects the header.

 

Sorry if I'm being completely honest now - I have never seen such a terrible document structure after a data merge!

 

But what the heck. 3 x Grep in a row should help
search

^~a{2,3}\r

replace with

[NOTHING]

 

search

\t\t\r		

replace with

[NOTHING]

 

search

~b~b+

replace with

\r

 

 

If that works for you

have fun

😉

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
community guidelines