Find and replace with regular expressions
Posted: Thu Oct 16, 2003 10:07 am
Hi,
I have a data file which contains floating point values with a comma as decimal separator (as it is usual in Germany). I want to replace these commas by the decimal point, but only in the floating point values; commas also appear elsewhere in the file, e.g. separating text. So I did a search with regular expressions; I searched for "[0-9],[0-9]" which works well. But if I want to replace these characters by "[0-9].[0-9]" the regular expressions are also inserted. Just entering the "." as replacement text does not work either (as expected). How can I achieve my goal of replacing only commas surrounded by numbers by a decimal point?
Thanks in advance,
Finn
I have a data file which contains floating point values with a comma as decimal separator (as it is usual in Germany). I want to replace these commas by the decimal point, but only in the floating point values; commas also appear elsewhere in the file, e.g. separating text. So I did a search with regular expressions; I searched for "[0-9],[0-9]" which works well. But if I want to replace these characters by "[0-9].[0-9]" the regular expressions are also inserted. Just entering the "." as replacement text does not work either (as expected). How can I achieve my goal of replacing only commas surrounded by numbers by a decimal point?
Thanks in advance,
Finn