in reply to Re: get the line of ith occurrence of '>' without OPENING THE FILE
in thread get the line of ith occurrence of '>' without OPENING THE FILE
Here you can use a buffer with a certain length and read that number of bytes at a time into thiis buffer.
OTOH, If the problem is that you can not split on the default line endings, you might also try setting $/ to something more suitable (e.g. when the file doesn't contain newlines and you're reading a line at at time).
{ local $/ = '>'; # you were looking for this one, right? open(FILE, "bigfile.big") or die $!; while (<FILE>) { # do interesting stuff # e.g. merely count lines... } close FILE; }
--
Cheers, Joe
|
|---|