We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSV standard RFC 4180, page 2 states:
Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes. For example: "aaa","b CRLF bb","ccc" CRLF zzz,yyy,xxx
"aaa","b CRLF bb","ccc" CRLF zzz,yyy,xxx
However, when we run this: ~/test_file.csv:
hotel_name,address,star_rating "County Hall","Westminster Bridge Road London",4 "St. Ermin's Hotel","2 Caxton Street London",5
~/csv_parser_test.js
const CSVParser = require('./csv-parser'); const parser = new CSVParser({ sourceFilePath: 'test_file.csv' }, { name: 'hotel_name', address: 'address', stars: 'star_rating', }); parser.on('object', (hotel, next) => { console.log(hotel); process.nextTick(next); }); parser.start();
We get 3 objects back:
$ node csv_parser_test.js { name: '"County Hall"', address: '"Westminster Bridge Road', stars: undefined } { name: 'London"', address: '4', stars: undefined } { name: '"St. Ermin\'s Hotel"', address: '"2 Caxton Street London"', stars: '5' }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CSV standard RFC 4180, page 2 states:
However, when we run this:
~/test_file.csv:
~/csv_parser_test.js
We get 3 objects back:
The text was updated successfully, but these errors were encountered: