Remove unnecessary newline from generated output file