DataSampler function

Generates data samples from text files