On my page i have a table with over 500 rows, in it one column where all cells contain a different numbers, such as 55123, 666000, 3000 and 1459000 (figures for sums of money). I would need to insert thin spaces in the numbers for them to be easier to read, according to the following scheme:
Seven digits in a row is changed to: d ddd ddd (eg 1 459 000, d=digit)
six to: ddd ddd (eg. 666 000)
five to: dd ddd (eg. 55 123)
Four to: d ddd (eg. 3000)
using find/change I am able to find all instances of for example 7 digits in a row with the grep line \d{7} but i am lost at having a command for how to "change" using the found numbers and adding a thin space at the right positions.
Is there a way of writing a script or a find/change query for this operation for doing this anywhere in the text (or just the table)? Any tips on this are much appreciated!