trim file contents