Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Index a file with pack for fast access

by BrowserUk (Patriarch)
on Dec 16, 2011 at 23:07 UTC ( [id://944026]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #! perl -slw
    use strict;
    ...
    syswrite INDEX, pack( 'N', 0 ), 4;
    syswrite INDEX, pack( 'N', tell *ARGV ), 4 while <>;
    close INDEX;
    
  2. or download this
    #! perl -slw
    use strict;
    ...
    
    printf "Ave. %.6f seconds/record\n", ( time() -$start ) / $N;
    
  3. or download this
    [23:03:42.25] c:\test>indexFile 1GB.csv
    
    ...
    [23:05:40.38] c:\test>readIndexedFile 1GB.csv
    Ave. 0.003991 seconds/record
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://944026]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found