Pre-process file