| Author |
perl String find and replace - count ?
|
kri shan
Ranch Hand
Joined: Apr 08, 2004
Posts: 1300
|
|
|
perl -pi -e 's/sample1/sample2/g' *.* replaces string value sample1 with sample2 globally. How do i add count (number of times sample1 string replaced) ?
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9948
|
|
|
perlmonks is always a great place to search. I found this, which appears to be your exact question.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: perl String find and replace - count ?
|
|
|