Reply To: Grep duplicate-select first instance

Home Page / Forums / InDesign User Groups / Grep duplicate-select first instance / Reply To: Grep duplicate-select first instance

#98100
Alley J
Participant

Thanks, David – I tried the script (changing the page_span to 0) & it just seemed to delete the first line (January) but I’m not sure what I’m doing there, exactly, so I’ll have another good look but I did work out a solution, based on Graham’s suggested Find. I just need to run one Grep, then run a 2nd one on the original text again:

Find what:
(January|February|March|April|May|June|July|August|September|October|November|December)\r(.*?)\r
(January|February|March|April|May|June|July|August|September|October|November|December)\r(.*?)$

Change to:
$1$2\r

& then again with the Change to:
$3$4\r

Perfectly seps out 1 year at a time. (I’ve been unsure about the ‘or’ symbol – whether it needs square brackets around it or not but this shows me when I do & don’t, too.)

Appreciate you both taking the time – it’s another ‘happily ever after’ in Grep land!

This article was last modified on September 14, 2017

Comments (0)

Loading comments...