Reply To: GREP or sth else? Number – space – number.

Home Page / Forums / General InDesign Topics (CLOSED) / GREP or sth else? Number – space – number. / Reply To: GREP or sth else? Number – space – number.

#78130
Peter Kahrel
Member

Forgot to mention that the GREP replacement in the previous post doesn’t work if a number is the last text in a cell or a story. To make it work everywhere you’d have to add a single symbol at the end of numbers at cell- and story-end, then run the above query, and finally remove that added symbol. For that symbol I use a hair space to reduce the impact on the document.

So you’d have three queries:

(Place a hair space at the end of each cell and each story)
Find what: (\d)\Z
Change to: $1~%

(Insert the thousands separators)
Find what: (\d)(?=(\d\d\d)+,?)
Change to: $1\x20

(Remove the hair spaces at the end of cells and stories)
Find what: ~%\Z
Change to: <nothing>

To make running sequences of GREP queries a bit easier, you can use this script:
https://www.kahrel.plus.com/indesign/grep_query_runner.html

Peter

This article was last modified on September 16, 2015

Comments (0)

Loading comments...