Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

expect quoting only on field beginning #16

Closed
wants to merge 2 commits into from

2 participants

Markus Ast Pavel Kolesnikov
Markus Ast

I think the following example:
random field content containing "some quoted text" without being quoted itself
shouldn't be handled as a quotedField.
(I personally need this tolerance because I have to parse user provided csv files ...)
What do you think?

I also updated the README.md node-formidable example (I needed these changes to got it work).

Ah and... thanks for ya-csv :-)

Pavel Kolesnikov
Owner

I don't want to make the parser too tolerant by default. If you still need this feature, how about making it configurable?

Sorry for the scandalously slow response.

Markus Ast

Sounds legit, to make the parser not too tolerant by default. I don't need this feature anymore. So, it is okay for me if we just close this pull request. Thanks anyway

Pavel Kolesnikov koles closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2012
  1. Markus Ast
  2. Markus Ast

    Update README.md

    rkusa authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 3 deletions.
  1. +2 −2 README.md
  2. +0 −1  lib/ya-csv.js
4 README.md
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()
1  lib/ya-csv.js
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) {
Something went wrong with that request. Please try again.