The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
strip first 4 and last 2 lines from a file using perl
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
strip first 4 and last 2 lines from a file using perl
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
02-01-2008
KevinADC
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.
KevinADC
View Public Profile
Find all posts by KevinADC