jonschlinkert / parse-csv

CSV parser for node.js
MIT License
15 stars 4 forks source link

Custom delimiter #5

Open aleksfes opened 6 years ago

aleksfes commented 6 years ago

Hi Jon,

This PR allows user to set custom delimiter, 'tab' value is still available.

My MS Excel (15.33 for Mac) exports csv files with ';' as a delimiter by default, but 'delimiter' of the Parse option has strange behaviour: 'toArray' function ignores 'opts.delimiter' parameter and tries to read 'opts.delim', 'delimiter' variable in Parser.prototype.parse is not used at all.

Also default value for 'opts.delimiter' parameter for the Parser class was changed to ',' to save backward compatibility - see tests.

With best regards, Alexander.