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
Find and replace with regular expressions
Moderators: AmigoJack, bbadmin, helios, MudGuard
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
-
BDifferent
- Posts: 2
- Joined: Thu Oct 16, 2003 9:58 am
Re: Find and replace with regular expression
That one works, thank you! However, a different solution has just come up: I could just change the system's country settings and create the data file again which then has the "." as decimal separator...s_reynisson wrote:Find ([0-9]),([0-9])
Replace \1.\2
Using Posix
Thanks for your efforts,
Finn