Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 ( [id://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?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-19 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found