Cleaning and splitting of files