Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: RegEx Question!

by Laurent_R (Abbot)
on Jun 08, 2013 at 11:22 UTC ( #1037841=note: print w/replies, xml ) Need Help??

in reply to RegEx Question!

You can also edit "in place" so that it actually looks as deleting the lines you don't want from the original file. Modifying HBM's example, this could look like this:

perl -i.bak -ne 'print unless /dontwant/' my_file.txt

There, unwanted lines will be removed from my_file.txt and the original version of the file will be saved with the .bak extension added.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037841]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2017-02-27 14:19 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (386 votes). Check out past polls.