Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Save all but line 32!

by jmcnamara (Monsignor)
on Sep 18, 2002 at 17:00 UTC ( #198914=note: print w/replies, xml ) Need Help??


in reply to Save all but line 32!


Here is another way:     perl -i -pe '$_=$}if$.==32' file

Update: To handle multiple files it needs to be a little longer:     perl -i -pe '$_=$}if$.==32;$.=$[if+eof' file1 file2 ...

But this is probably the cleanest way:     awk 'FNR != 32' file1 file2 ...

--
John.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2020-10-24 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (243 votes). Check out past polls.

    Notices?