This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Empty lines not skipped #122
Comments
I just noticed this same issue in our setup and came here to note it, thanks. Although in our case it doesn't look like we have any empty lines at the end, it just simply passes an empty object for the last row parsed (after the last valid row). |
seems related to one of the latest commit, will look soon |
Yes, I reverted to 1.1.0, and it's back to normal. |
wdavidw
added a commit
that referenced
this issue
Jan 9, 2017
shall be fixed now with 1.1.9 |
Thanks, fixed now. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
var csv = require("csv")
var report = "Date,Value\n" +
"2016/02/11,5341022\n" +
"2016/02/12,4771\n" +
"2016/02/12,5341022\n\n\n";
var csvOpts = {columns: true, skip_empty_lines: true, trim: true, auto_parse: true};
csv.parse(report, csvOpts, function(err, data) {
console.log(data);
});
The above code prints 4 objects instead of 3. The last one has a single field "Date"
0: Object {Date: "2016/02/11", …}
1: Object {Date: "2016/02/12", …}
2: Object {Date: "2016/02/12", …}
3: Object {Date: ""…}
The text was updated successfully, but these errors were encountered: