Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

•Re: Randomize lines with limited memory

by merlyn (Sage)
on Nov 02, 2003 at 00:28 UTC ( #303862=note: print w/replies, xml ) Need Help??

in reply to Randomize lines with limited memory

I question the need to randomize the file and rewrite it in the first place. Using something like DBD::SQLite, you can store this stuff into a structured flat file, then write a series of random numbers into a second column, and then select items from your entries column based on a sort of the second column (or write a shuffled index list into the second column).

Anytime something sounds this hard, it's better to back up a step and say "what corner did I paint myself in to, and how did I get here?". Always question the context.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: Randomize lines with limited memory

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2016-10-23 17:18 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.