This one liner
perl -i.bak -pe 's/123456/234165/' filename
will change only one occurrence of the pattern, modify your file in place and save the old one with a ".bak" extension.
To change every occurrence of the pattern, use
s/123456/234165/g
In reply to Re: Changing file contents
by rnahi
in thread Changing file contents
by bh_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |