[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Only read the first 30 lines of a file?



Chilton Webb wrote:
> 
> In MacPerl, what's a good way to read only the first 30 lines of a file? 
> I have a program that looks for certain info in several thousand files, 
> and these files are hundreds of k long. The info, however, is typically 
> in the first 10 or 20 lines. How can I do this?
> 

Count each line as you read it in.  Stop when you reach 30.

Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org