Python Script to Read a text file, do some REGEX processing and write to another file.