in reply to Randomizing Big Files
If you load the database with the lines of your file and assign a (sufficiently large) random number to an indexed extra field, you can sort on this field and you will have effectively shuffled your large file.
Databases are specifically optimized to do such things, so why re-invent the wheel?
If you have to reshuffle the database, all you have to do is update the field with the random number in it with another random number: one simple SQL-statement will do the trick.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Randomizing Big Files
by Anonymous Monk on Jan 26, 2005 at 15:54 UTC | |
by CountZero (Bishop) on Jan 26, 2005 at 19:23 UTC |