Skip to main content
Spenno
Inspiring
August 15, 2023
Question

GREP to add space in 6 digit numbers

  • August 15, 2023
  • 3 replies
  • 348 views

Hi all. As the title suggests, I have a long list of product SKUs in a document and the powers that be would like the 6 digit SKU to have a space in the middle ie be two groups of 3 digits. Any chance of help with a GREP that I can use with this paragrapgh style to automate this? Thanks for any input.

This topic has been closed for replies.

3 replies

FRIdNGE
August 15, 2023

I just answer to Spenno's question: use a Grep style in your para style:

 

 

 

(^/)  The Jedi

Barb Binder
Community Expert
Community Expert
August 15, 2023

Hi @Spenno:

 

Any chance of help with a GREP that I can use with this paragrapgh style to automate this?

We use GREP in two locations in InDesign: as a Find/Change activity and a GREP style.

 

We use GREP styles in a paragraph style to apply formatting and Find/Change to edit the content. In your case, if you want to add a space between six characters you can use Robert's suggestion as a Find/Change GREP query and not in a paragraph style.

 

 

~Barb

~Barb at Rocky Mountain Training
Robert at ID-Tasker
Legend
August 15, 2023

Replying from my phone but I think it would be something like this:

 

(\d\d\d)(\d\d\d)

 

$1(space you want)$2