Perl: replace character in file
Hello,
I've read all the topics on this problem, the solution works, but not for my specific problem. I want to replace a dot by a comma in a .txt file This should be possible by doing this on the command line: /usr/bin/perl -p -i.bak -e "s/./,/g" *.txt This returns the *.txt file full with comma's (and a .bak backup file), it replaced every character with a comma. If I do this: /usr/bin/perl -p -i.bak -e "s/i/,/g" *.txt then it works fine and it replaces every 'i' with a comma. So it seems it does work with every character, except dots :( It might be a noobisch question, but can somebody help me to fix this? |
this would work,
Code:
s/\./,/g |
thanks for the fast reply, it works
(this is my first day programming perl) |
Quote:
|
Yes, I understand now, figured that . means every character. Didn't know about the '\' escape
|
All times are GMT -5. The time now is 01:00 AM. |