There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
That's a good point, bobf. I think there are two possibilities.
(1) He only needs to get a random sample from this file once. (2) He needs to get random samples from this file more than once, and needs each one to be random not only in and of itself but also in the sense of being uncorrelated with the other samples. If it's #1, then I think it works to take a random byte position and then read the next record. If it's #2, then he can't use that method, and I think he clearly would be better off creating in index (or using the facilities of a database or filesystem). In reply to Re^6: Random sampling a variable length file.
by bcrowell2
|
|