Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • lines in random order, or a random block of 1000 consecutive lines of that file? Commented Jan 9, 2014 at 17:49
  • Every line gets the same probability to be chosen. Don't need to be consecutive although there is a tiny probability that a consecutive block of lines be chosen together. I've updated my question to clearer about that. Thanks. Commented Jan 9, 2014 at 18:08
  • My github.com/barrycarter/bcapps/tree/master/bc-fastrand.pl does this approximately by seeking to a random location in the file and finding the nearest newlines. Commented Apr 18, 2019 at 18:18