(Ted Harding) wrote:
Interesting thread! Now that it looks as though vim is romping home in its rightful place at the head of the field, let me ask advocates of other editors how they would achieve the following editing task.
You have a long document, in which are lots of occurrences of numbers which have the Contintental separator system ("." to separate thousands, "," for the decimal point). So, for instance, one million Francs and 25 Centimes is 1.000.000,25
Now run a global edit to convert these into the Real Thing, so that the above example becomes 1,000,000.25 for instance.
<untested and from memory> for vi / vim
:1,$s/([0-9]).([0-9])/\1~#~\2/g :1,$s/([0-9]),([0-9])/\1.\2/g :1,$s/~#~/,/g
for kate (check reg exp & use place holders) [ctrl]+R <find string>([0-9]),([0-9]) <replace string> \1~#~\2 [ctrl]+R <find string>([0-9]).([0-9]) <replace string> \1,\2 [ctrl]+R <find string>~#~ <replace string> .
easy.