Python code to parse  txt files.