Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: RegEx Question!

by Laurent_R (Vicar)
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.


Comment on Re: RegEx Question!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-08-22 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (168 votes), past polls