Re: unhead
Jasvir Nagra <[email protected]>
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <1096055546.1915.3.camel@monk> |
We can also try clobbering the particular lines you don't want. Fr'instance for all but the first 5 lines perl -pe '$_=""if$.<=5' On Sat, 2004-09-25 at 02:17, 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 > -- Jasvir Nagra http://www.cs.auckland.ac.nz/~jas
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBBVHr6v/AoArEwaEgRAs9tAJ4gUILTHQXfmALOhQctFCFw4ynnNACfW+qq 2XWj97GiasMYN4xXj8cNgS0= =jgpa -----END PGP SIGNATURE-----