Updated to preprocess a text file