RE: unhead

"Allen, Greg" <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
fun with sed & tail...

sed 1,5d
tail +6

Greg.


-----Original Message-----
From: John Douglas Porter [mailto:[email protected]] 
Sent: Saturday, September 25, 2004 4:40 AM
To: [email protected]
Subject: Re: unhead



I think we'd like to avoid solutions that involve loading
entire file into an array, agreed?

Here's how I'd do it:

  sed -n '5,$p'

-- 
John Douglas Porter



Josh Goldberg <[email protected]> wrote:

> Here's a little oneliner to skip the first 5 lines of the file 'foo':
> 
> perl -i5 -e '@_=<STDIN>;print@_[$^I..$#_]' < foo
> 
> On Sep 24, 2004, at 7:17 AM, Jose Alves de Castro wrote:
> 
> > You're probably all familiar with the commands "head" and "tail",
> which
> >  let you extract the first or the last N lines of input or a
> file...
> >
> > Imagine you want to print a file, but without the first N lines...
> >
> > For N=1, one possibility would be:
> >
> > print if $. - 1;
> >
> > For any N, maybe this:
> >
> > print if ($N+1)..0;
> >
> > Any thoughts? Any other ideas? What would be the best way to do
> this?
> >
> >
> > Regards,
> >
> > jac
> >
> > -- 
> > José Alves de Castro <[email protected]>
> >   http://natura.di.uminho.pt/~jac
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.