Skip to main content
Participating Frequently
February 15, 2023
Answered

GREP for finding duplicate price and measurement in paragraphs

  • February 15, 2023
  • 1 reply
  • 1407 views

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 has been closed for replies.
Correct answer m1b

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

1 reply

m1b
Community Expert
Community Expert
February 15, 2023

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

Participating Frequently
February 15, 2023

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.

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
February 15, 2023

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