Copy link to clipboard
Copied
I need to convert all my numbers from what I think is the french way to American/English.
Ex:
1 023 696 Correct 1,023,696
0,04 correct 0.04
I've found a Grep style converting all space to, that's brilliant, except that all my numbers have a space at the end so I end up with a comma at the end as well...
Does anyone know how I can delete space after a number in a table cell?
Find
\h(?=\d{3})
This finds any horizontal space - looks ahead for 3 digits
Technically
1 00 - won't work
1 000 replaced by 1,000
1 000 000 replace by 1,000,000
and so on
The other grep would be
(\d),(\d{2})
$1.$2
GREP looks for patterns - so if the pattern doesn't fit you need another pattern.
It might be possible - you'd have to give examples of live text to test fully.
Space-comma replacement:
Find what: \d\K\h(?=\d\d\d)
Change to: ,
Copy link to clipboard
Copied
Find
\h(?=\d{3})
This finds any horizontal space - looks ahead for 3 digits
Technically
1 00 - won't work
1 000 replaced by 1,000
1 000 000 replace by 1,000,000
and so on
The other grep would be
(\d),(\d{2})
$1.$2
Copy link to clipboard
Copied
Thanks! It almost works like magic! Some numbers like 156 have a space in front and end up ,156. Anyway to get around that?
The other grep works perfectly!
Copy link to clipboard
Copied
GREP looks for patterns - so if the pattern doesn't fit you need another pattern.
It might be possible - you'd have to give examples of live text to test fully.
Copy link to clipboard
Copied
Space-comma replacement:
Find what: \d\K\h(?=\d\d\d)
Change to: ,