Skip to main content
Lloydie J
Participating Frequently
April 28, 2023
Question

Can you search for duplicate numbers in an InDesign document?

  • April 28, 2023
  • 2 replies
  • 667 views

Is there a way to search an InDesign file for duplicate number strings? I'm working on a catalog that uses like-formatted SKU numbers (25-xxxxxx-1) for all items. I need to search the document for duplicate SKU numbers. Is there a function that will do this? I'm working in InDesign 18.2.1 on a Mac running Ventura.

 

Thanks,

Lloyd

This topic has been closed for replies.

2 replies

Peter Spier
Community Expert
Community Expert
April 29, 2023

I think this will need a script if you are looking at a 'general' case where you find the first instance of any SKU number, rather than a particular number, then find duplicates, and move on to a new unique SKU and repeat. Like Steve, I'm not a GREP expert, but it seems to me that to use Find/Change manually you would need to enter each SKU manually in the dialog.

I'm also not a script writer, but if you actually have a list of the SKU numbers it should be pretty straight forward to iterate through the list. If not, the search will have to try 999,999 (based on your 25-xxxxxx-1 example) numbers many of which probably don't exist, and that may take a long time.

 

Robert at ID-Tasker
Legend
April 29, 2023

Script would be pretty straight forward - I'm not JS guy:

  1.  Use GREP to find all strings 25-xxxxxx-1, 
  2.  Store results in an array,
  3.  Sort this array. 
  4. Check for duplicates

 

Steve Werner
Community Expert
Community Expert
April 29, 2023

It sounds like something that could be handled with a GREP search. I'm not a GREP expert but I expect you'll get some help soon.