fixed end-of-file newline issue for CSV files