diff options
-rw-r--r-- | Source/TableDump.m | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index e555786b..15a8c344 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -2128,20 +2128,18 @@ options:NSLiteralSearch range:NSMakeRange(0, [csvCellString length])]; } - - // Escape occurrences of the line end character - [csvCellString replaceOccurrencesOfString:lineEndString - withString:escapedLineEndString - options:NSLiteralSearch - range:NSMakeRange(0, [csvCellString length])]; // If the string isn't quoted or otherwise enclosed, escape occurrences of the - // field separators + // field separators and line end character if ( quoteFieldSeparators || csvCellIsNumeric ) { [csvCellString replaceOccurrencesOfString:fieldSeparatorString withString:escapedFieldSeparatorString options:NSLiteralSearch range:NSMakeRange(0, [csvCellString length])]; + [csvCellString replaceOccurrencesOfString:lineEndString + withString:escapedLineEndString + options:NSLiteralSearch + range:NSMakeRange(0, [csvCellString length])]; } // Write out the cell data by appending strings - this is significantly faster than stringWithFormat. |