GREP increment numbers

298 views
Skip to first unread message

C F Majors

unread,
Sep 20, 2016, 1:07:24 PM9/20/16
to indesi...@googlegroups.com

C F Majors

unread,
Sep 20, 2016, 1:09:22 PM9/20/16
to indesi...@googlegroups.com
According to this -- the numbers at the top of the script are your range. Read down in the comments. 

Carol Majors 

Paul Marriner

unread,
Sep 20, 2016, 3:57:29 PM9/20/16
to indesign-talk
Hi Carol, yes, this was the original script I quoted. And I did read all the comments.

--
You received this message because you are subscribed to the Google Groups "InDesign talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to indesign-talk+unsubscribe@googlegroups.com.
To post to this group, send email to indesi...@googlegroups.com.
Visit this group at https://groups.google.com/group/indesign-talk.
For more options, visit https://groups.google.com/d/optout.

Paul Marriner

unread,
Sep 20, 2016, 4:02:27 PM9/20/16
to indesign-talk
As I replied to your first post, I did read the comments. The numbers at the top seem to be irrelevant because I changed them but the script failed in the same way. However, I think some of the grep info might make it possible to select a range as long as it doesn't include an increase in the number of digits, e.g. select from 69 to 99, then from 100 to 169. 

C F Majors

unread,
Sep 20, 2016, 4:44:36 PM9/20/16
to Indesign talk 2010
Using the clues provided by Phil to the links i sent, here is your search parameter. You do this in the find and change window. 

[13-40]\d+|[\d]{3,}

It finds all 3 digit numbers in the word boundary that start with 13 thru 40 (that is 130 to 400). I am sorry I don’t know how to adapt it to 136 and above, but trust you can look manually for those 5 numbers. 

I set the second part to replace it with blue ink and keep the number. 

If you can find the number incremental part that Phil recommends, you’ve got it. 

Then save that script in your find and change window. 

I am on deadline, and therefore enjoying this problem more than I should!

But it is a great puzzler. 




.   .   .   .   .   .   .   .   .   .   .   .   .    .   .
Carol Majors / Publications unltd 
Raleigh NC




To unsubscribe from this group and stop receiving emails from it, send an email to indesign-tal...@googlegroups.com.

C F Majors

unread,
Sep 20, 2016, 4:51:34 PM9/20/16
to Indesign talk 2010
SO, when you set up this find/change, make sure that the Replace names a char style, because then you adjust your chosen numbers in a separate way, using this handy-dandy script. 


Now all is well. Right!?

Carol 

.   .   .   .   .   .   .   .   .   .   .   .   .    .   .
Carol Majors / Publications unltd 
Raleigh NC




On Sep 20, 2016, at 4:44 PM, C F Majors <cfma...@gmail.com> wrote:

Using the clues provided by Phil to the links i sent, here is your search parameter. You do this in the find and change window. 

[13-40]\d+|[\d]{3,}

It finds all 3 digit numbers in the word boundary that start with 13 thru 40 (that is 130 to 400). I am sorry I don’t know how to adapt it to 136 and above, but trust you can look manually for those 5 numbers. 

I set the second part to replace it with blue ink and keep the number. 

If you can find the number incremental part that Phil recommends, you’ve got it. 

Then save that script in your find and change window. 

I am on deadline, and therefore enjoying this problem more than I should!

But it is a great puzzler. 

<Screen Shot 2016-09-20 at 4.38.12 PM.png>

Jean-Claude Tremblay

unread,
Sep 20, 2016, 5:03:48 PM9/20/16
to indesi...@googlegroups.com
This GREG won’t work… It only selects  10 to 19, 30 to 49 ND 100 and above.

If you need to select 122 and above (up to 999) use this:

12[2-9]|1[3-9]\d|[2-9]\d\d

JC

On Sep 20, 2016, at 16:51, C F Majors <cfma...@gmail.com> wrote:

C F Majors

unread,
Sep 21, 2016, 12:33:30 AM9/21/16
to Indesign talk 2010
What I reported earlier works in Indesign. 

Use J-Cs “find replace formula” in the find/change window (instead of the one I used) if you are looking for 122 and up. 

12[2-9]|1[3-9]\d|[2-9]\d\d

Be sure to create a char style for the replaced part. This is a screen shot I used in the earlier post. Down there at the bottom is where you would select the Char Style. 



Install the handy-dandy script I linked to, run it using the char style as your parameter, bottom of window. Tell it to Add 1 (top of window). Make all changes a new color so you can check them. 

SO, when you set up this find/change, make sure that the Replace names a char style, because then you adjust your chosen numbers in a separate way, using this script. 


It's done. 
.   .   .   .   .   .   .   .   .   .   .   .   .    .   .
Carol Majors / Publications unltd 
Raleigh NC




Paul Marriner

unread,
Sep 21, 2016, 7:46:48 AM9/21/16
to indesign-talk
Thanks very much Carol. Works as advertised. This was a very useful exercise for me. Once you see the logic of the grep search parameters the rest is easy. Although this is more of a concordance than a true index it also handled page number ranges (e.g. 63-68).

Once again, thanks for all your time and efforts.

Paul

On Wed, Sep 21, 2016 at 1:33 AM, C F Majors <cfma...@gmail.com> wrote:
What I reported earlier works in Indesign. 

Use J-Cs “find replace formula” in the find/change window (instead of the one I used) if you are looking for 122 and up. 

12[2-9]|1[3-9]\d|[2-9]\d\d

Be sure to create a char style for the replaced part. This is a screen shot I used in the earlier post. Down there at the bottom is where you would select the Char Style. 



Install the handy-dandy script I linked to, run it using the char style as your parameter, bottom of window. Tell it to Add 1 (top of window). Make all changes a new color so you can check them. 

SO, when you set up this find/change, make sure that the Replace names a char style, because then you adjust your chosen numbers in a separate way, using this script. 


It's done. 
.   .   .   .   .   .   .   .   .   .   .   .   .    .   .
Carol Majors / Publications unltd 
Raleigh NC




On Sep 20, 2016, at 5:03 PM, Jean-Claude Tremblay <tremb...@videotron.ca> wrote:

This GREG won’t work… It only selects  10 to 19, 30 to 49 ND 100 and above.

If you need to select 122 and above (up to 999) use this:

12[2-9]|1[3-9]\d|[2-9]\d\d

JC

On Sep 20, 2016, at 16:51, C F Majors <cfma...@gmail.com> wrote:


On Sep 20, 2016, at 4:44 PM, C F Majors <cfma...@gmail.com> wrote:

Using the clues provided by Phil to the links i sent, here is your search parameter. You do this in the find and change window. 

[13-40]\d+|[\d]{3,}


--
You received this message because you are subscribed to the Google Groups "InDesign talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to indesign-talk+unsubscribe@googlegroups.com.

To post to this group, send email to indesi...@googlegroups.com.
Visit this group at https://groups.google.com/group/indesign-talk.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "InDesign talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to indesign-talk+unsubscribe@googlegroups.com.

Paul Marriner

unread,
Sep 21, 2016, 7:51:32 AM9/21/16
to indesign-talk
Thanks for hanging in there J-C. Now that I see the logic of your grep expression I can modify it to suit any start number.

Thanks again from 1k km east of you.

Paul

Reply all
Reply to author
Forward
0 new messages