The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-01-2008
KevinADC KevinADC is offline
Registered User
 

Join Date: Jan 2008
Posts: 338
this should do eaxctly that:

open(FH,'file');
@array = <FH>;
close FH;
open(OUT,'>','outfile');
print OUT @array[4..$#array-2];
close OUT;

Might not work if the file is too big to fit into memory.
Reply With Quote