develooper Front page | perl.beginners | Postings from February 2002

Printing lines after a designed matching line!

Thread Next
From:
Tran, Thuy
Date:
February 27, 2002 07:14
Subject:
Printing lines after a designed matching line!
Message ID:
0560141A7916D211A64A00A0C9C9A815050D7564@nwms15.chinalake.navy.mil
Hi all,
I would like to prints a specified number of lines from a file that after
any line match a specified regular expression (ex. UID)


open(FILE, 'data' ) or die "can't open";
if start ! = UID
 skip line;
else 
  read 100 lines below UID
end if


__data__
Nov 2002  Page 1

UID       CPU_PRIME         #SESSION
0              2                        0
1              3                        0
.......

Nov 2002 Page 2 

Thank you so much for helping me.

Thuy Tran



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About