Copy link to clipboard
Copied
I have a bunch of numbers looking like this:
1340,10
1032,10
I need to do a search and replace which inserts thousand separator like this:
1.340,10
1.032,10
Can it be done using GREP or some other kind of script which "counts the numbers" and inserts dots where needed?
Best regards
Bjørn
Copy link to clipboard
Copied
There is this free script which I wrote a while ago: https://www.id-extras.com/script-to-format-long-numbers
I think it should work to do what you want (been a while since I've used it).
If all your numbers are exactly 4 digits, of course, a script isn't necessary, as a fairly simple GREP would work. But if the numbers are of varying length, the script is probably the easiest way to go...
Ariel
Copy link to clipboard
Copied
find:(\d{1,2})(\d{3}),(\d{2}) change:$1.$2,$3
Copy link to clipboard
Copied
Nice, but won't work obviously for numbers over 99999...
Copy link to clipboard
Copied
Try this...
Find: (\d)(?=(\d\d\d)+\b)
Replace: $1.