$ perl -le " for( @ARGV ){ print; s{(.)}{$1.++$counter}ge; print} " a +bc XYZ abc a1b2c3 XYZ X4Y5Z6 ## perl -pTe "s{(core:para edpnum-start=\x22)}{$1.++$counter}ge; " < +test.xml > testcounted.xml ## perl -pi.orig -Te "s{(core:para edpnum-start=\x22)}{$1.++$counter}g +e; " test.xml ## diff -u test.orig test.xml
In reply to Re: search and replace plus counter
by Anonymous Monk
in thread search and replace plus counter
by Harkers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |