Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Read Some lines in Tera byte file

by BrowserUk (Pope)
on Oct 13, 2010 at 07:12 UTC ( #865029=note: print w/replies, xml ) Need Help??


in reply to Read Some lines in Tera byte file

  • If you need to read line 100 once, read from the beginning.
  • If you know you'll need to read line 100 again, remember where (tell) in the file it was located.

    And while you're at it, you may as well remember where lines 1 through 99 where located also.

  • If you need to read lines at random and often, and quickly: see Re: help reading from large file needed.

    It will take a local file, of ( 8*number-of-lines ) bytes, to hold the index, and roughly the same amount of time as wc -l.

    With a slightly more sophisticated indexer, the size of the index file can be reduced by half.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://865029]
help
Chatterbox?
[pryrt]: The mismatched ones have a Jan 23 2017 Last-Modified header -- I wonder if they rezipped them and forgot to update the sha1
[stevieb]: RT ticket for the csum mismatch of various versions of Strawberry Perl

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-03-29 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (353 votes). Check out past polls.