-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Does not handle escaped strings #19
Comments
Adding my support for this item - we are downstream from elb2loggly and this is a blocker for getting reliable logging from our load-balancers due to this issue. Tagging the downstream issue: cboscolo/elb2loggly#22 |
Sorry for not responding. I'm looking into into it right now! |
so, as far as i understand it, we have the following problem: '"' === '\"' // true The escaped and the unescaped quotation marks are the same in JS, because '' is the escape character of javascript strings (or I just haven't found a way to make sense of this yet). You can't choose another escape char, I assume? For example in csv
|
Unfortunately, the CSV files are being generated by AWS, so I have no control over how they escape the double quote. I tried to two double quotes |
I'm not saying But: I could also be totally wrong and missing the point. |
I am using csv-streamify in my log parsing project: https://github.com/cboscolo/elb2loggly.
Parsing lines with escaped strings does not work properly. For example, using
var csvToJson = csv({objectMode: true, delimiter: ' '});
to parse this line:2016-06-01T14:09:00.418027Z anaconda-org "GET https://pypi.anaconda.org:443/username/simple/virtualenv/ HTTP/1.1" "pip/8.1.2 {\"openssl_version\":\"OpenSSL 1.0.2d 9 Jul 2015\"}" TLSv1.2
Results in this:
[ "2016-06-01T14:09:00.418027Z", "anaconda-org", "GET https://pypi.anaconda.org:443/username/simple/virtualenv/ HTTP/1.1", "pip/8.1.2 {\\openssl_version\\:\\OpenSSL", "1.0.2d", "9", "Jul", "2015\\}", "TLSv1.2" ]
Instead of this:
[ "2016-06-01T14:09:00.418027Z", "anaconda-org", "GET https://pypi.anaconda.org:443/username/simple/virtualenv/ HTTP/1.1", "pip/8.1.2 {"openssl_version":"OpenSSL 1.0.2d 9 Jul 2015"}", "TLSv1.2" ]
Have you considered adding support for escaped strings? If not, do you know of any other csv parsing npm modules that do?
The text was updated successfully, but these errors were encountered: