Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Randomize lines with limited memory

by Anonymous Monk
on Nov 03, 2003 at 21:57 UTC ( #304257=note: print w/replies, xml ) Need Help??


in reply to Randomize lines with limited memory

Buckets. Buckets buckets buckets.

Open in file,
open (n) out files,
read line by line,
output to out file rand(n)
close all files
append all out files together at end

for better randomness, greater (n) is good, and operation can be repeated as many times as desired. Do it at least twice to avoid order bias.

love the buckets

  • 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://304257]
help
Chatterbox?
[holli]: I got into a fight yesterday and won.
[holli]: No, that's not true. I started it.
[holli]: I was company to my mother, bringing her to the therapy she has to take. There was another so called therapist outside smoking. We engaged in a talk with her and he turned out to be one of these lunatics telling people when they are sick it's their own
[holli]: fault for not thinking positively enough.
[LanX]: did he seriously hurt his fist at your nose in the end?
LanX .oO(positively thought)
[holli]: :) No. I might be small, but you don't want to be around me when I flip.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-12-13 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (373 votes). Check out past polls.

    Notices?