remove extra characters in file