Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Reading HUGE file multiple times

by Laurent_R (Canon)
on Apr 28, 2013 at 16:03 UTC ( #1031092=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ wc file182730char.txt
         1  28947 182729 file182730char.txt
    
  2. or download this
    $ perl -e '$t = <>; for (1..28000) { $c = int rand 28888; $d = int rand 28888; print "> $c $d \n"; print $t}' file182730char.txt > file5gb.txt
  3. or download this
    $ time  wc file5gb.txt
         56000  810600000 5116810585 file5gb.txt
    
    real    7m54.609s
    user    4m3.436s
    sys     0m10.530s
    
  4. or download this
    > 12048 6179
    reprise de la session [...] commission ne peut tout faire
    > 1024 7912
    ...
    > 3926 17512
    reprise de la session [...] commission ne peut tout faire
    > 15268 6071
    
  5. or download this
    $ perl -ne 'if (/^> /) { ($c, $d) = (split)[1,2];} else { print join " ", (split)[$c,$d]; print "\n"};' file5gb.txt > foo.txt
  6. or download this
    $ head foo.txt
    ceux cen
    la incapables
    ...
    au ces
    consequences que
    un le
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2019-03-20 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (97 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!