inital code for removing leading and trailing whitespace from each line. and writing a new file or overwriting an existing one