Skip to main content
Participating Frequently
Feb 15, 2023 4:21 AM UTC
Answered

GREP for finding duplicate price and measurement in paragraphs

Hi there. I hope one of you intelligent peeps can help me with GREP issue. Been hunting around and nothing really helps. I have duplicate sizes and pricing within the same text box and am hoping to remove the duplicate. It is separated with a return after each line. Is this even possible? Or is there a script? So looked like this below, also repeats with lots of different sizing and prices (see screenshot attached).

 

1200 x 900mm
$4424

–

1200 x 900mm

$4424

 

Thanking you in advance

Anton

This topic is closed to new replies. Start a new post to keep the conversation going.
m1b
m1bCorrect answer
Community Expert
Feb 15, 2023 5:21 AM UTC

Okay, I see. You have a linefeed after the dimensions, not a return. Try this:

9 replies

m1b
Community Expert
Community Expert
Feb 15, 2023 4:37 AM UTC

Hi @antone78177033, this worked for me:

Things to note:

• I've assumed there is just a carriage return after each line break and the short rule in between is done with a paragraph rule, not another line. If another line, put it in the grep.

• I might not have used the same multiplication character that you did, so put that in the grep if necessary.

- Mark

Translate
Participating Frequently
Feb 15, 2023 4:56 AM UTC

Hi Mark, firstly thank you so much for your quick response and woah and that's some GREP. It does says 'Cannot find match'? not sure if I miss-keyed anything (I don't think so though 'x' is just a normal x right?), see screenshot attached. Sorry for my dumbness, is a carriage return a hard return? This information is automated into InDesign, so these could be soft returns. The Short Rule in between copy is done with a Paragraph Rule within paragraph styles. I have attached small example in InDesign attached.

Thank you again for your help, it is very much appreciated.

Translate
m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
Feb 15, 2023 5:21 AM UTC

Okay, I see. You have a linefeed after the dimensions, not a return. Try this:

Translate