Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Answer: How can I find and remove a line from a file.

by mpd (Monk)
on Aug 30, 2003 at 05:20 UTC ( #287876=note: print w/replies, xml ) Need Help??


in reply to Re: How can I find and delete a line from a file?
in thread How can I find and delete a line from a file?

If you know the exact line number you want to "delete," try this one-liner:
perl -ni -e "print unless $. == $linenum" <filename>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://287876]
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: (7)
As of 2021-12-09 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?