mafintosh / csv-parser

Streaming csv parser inspired by binary-csv that aims to be faster than everyone else
MIT License
1.41k stars 134 forks source link

Support null or undefined quote option. #139

Closed joshkay closed 4 years ago

joshkay commented 4 years ago

Feature Proposal

Allow the quote option to be null or undefined.

Feature Use Case

I am currently trying to parse a tsv that contains all kinds of characters including " and '. I tried to set the quote option to null or undefined to completely ignore any of those characters, but this throws an error. The workaround I have found is to use a character that doesn't exist in the file at all. However, this isn't ideal as it will break if that character is ever added.

shellscape commented 4 years ago

Thanks for the proposal 🍺

There are tons of unicode control and whitespace characters (or hell, even emoji or crazy bullet chars) that could be utilized there. For example, it's highly unlikely that someone is going to be exporting data with Cherokee Script. I can't give you a longer explanation at the moment, but it's a particular pain in the butt to allow a falsy value for that option.

Apologies for the abrupt closure, but it's one with many options for getting around, and one that's too difficult to accomodate with the current state of the parser. (We are working on a future branch with a rewrite of the parser however, and it may support falsy for the quote option when we're done. Hard to say now)

joshkay commented 4 years ago

Fair enough! Thanks for the explanation. I took a look at the source and can definitely see how that would be a pain to implement.