expect quoting only on field beginning #16

Closed
wants to merge 2 commits into
from
+2 −3
Split
View
@@ -77,14 +77,14 @@ Parsing an upload as the data comes in, using node-formidable:
upload_form.onPart = function(part) {
if (!part.filename) { upload_form.handlePart(part); return }
- var reader = csv.createCsvFileReader({'comment': '#'});
+ var reader = csv.createCsvStreamReader({'comment': '#'});
reader.addListener('data', function(data) {
saveRecord(data);
});
part.on('data', function(buffer) {
// Pipe incoming data into the reader.
- reader.parse(buffer);
+ reader.parse(buffer.toString());
});
part.on('end', function() {
reader.end()
View
@@ -121,7 +121,6 @@ CsvReader.prototype.parse = function(data) {
}
if (!isEscape && (c === this.quotechar)) {
if (ps.openField && !ps.quotedField) {
- ps.quotedField = true;
break;
}
if (ps.quotedField) {