divide data into train.txt and text.txt queried by a person