Fix for CSV output file being broken when field value contains line breaks