Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Changing file contents

by rnahi (Curate)
on May 29, 2003 at 08:06 UTC ( #261509=note: print w/ replies, xml ) Need Help??


in reply to Changing file contents

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


Comment on Re: Changing file contents
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://261509]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-09-22 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls