Remove trailing newline when reading a file