Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: What is the best way to remove(delete) specific lines from a very large file?

by fundflow (Chaplain)
on Dec 02, 2001 at 22:55 UTC ( #128996=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    cat big-file.txt | grep -v 'bad line' > new-file.txt
    
  2. or download this
    perl -i.orig -pe '$_="" if /bad line/' big-file.txt
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2021-05-07 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (93 votes). Check out past polls.

    Notices?