Remove extra space from the end of files