Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Changing the contents of a file

by l3v3l (Monk)
on Feb 02, 2006 at 23:16 UTC ( #527493=note: print w/replies, xml ) Need Help??


in reply to Changing the contents of a file

Since what you are substituting always occurs at the end of a line, the easiest way to do this seems to me to be something like:
perl -pi -e 's/turkey$/fox/' file_full_of_turkeys_that_you_want_to_be_ +foxes

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-05-21 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?