Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Randomize lines with limited memory

by gjb (Vicar)
on Nov 01, 2003 at 22:15 UTC ( #303845=note: print w/replies, xml ) Need Help??


in reply to Randomize lines with limited memory

If you don't really need a fair shuffle, you could get around the memory limitations by simply process the file by parts. Do a fair shuffle on each of the parts, and cat them together in random order.
For better results, do this a number of times using a non-zero offset.

Of course, you won't have a real fair shuffle, but maybe this is good enough.

Hope this helps, -gjb-

  • Comment on Re: Randomize lines with limited memory

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://303845]
help
Chatterbox?
[Discipulus]: water on moon? they can finally produce beer!
[Corion]: Discipulus++ # focus on the important things

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2017-07-25 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (366 votes). Check out past polls.