For a tecnhique that achieves a pretty good "random" selection, with needing to read every line in the file, see Re: Approach to efficiently choose a random line from a large file.
And for a few thoughts about the randomness of such an approach see Re^2: Approach to efficiently choose a random line from a large file.
In reply to Re: selecting N random lines from a file in one pass
by BrowserUk
in thread selecting N random lines from a file in one pass
by seuratt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |