including function to preprocess the text file