Remove whitespace and change newline character