script to extract a random sample out of a dataset