Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

•Re: Randomize lines with limited memory

by merlyn (Sage)
on Nov 02, 2003 at 00:28 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found