Skip to content

double quotes around csv fields #3

New issue

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

Open
leemthai opened this issue Mar 29, 2022 · 0 comments
Open

double quotes around csv fields #3

leemthai opened this issue Mar 29, 2022 · 0 comments

Comments

@leemthai
Copy link

leemthai commented Mar 29, 2022

Hi Nathan,

Thanks for your excellent code. I am using it to read a CSV into my app from google sheets.

My issue is some of my fields have double quotes put around them by google sheets because the actual field contains commas.

e.g.

field1, "field 2, more field2, even more field2", field3

This seems to break the code somewhere in here I guess:

const values = row.split(delimiter);
const el = headers.reduce(function (object, header, index) {
object[header] = values[index];

Any ideas which bit is breaking? I guess it must be the 'split' function??

I'm a very average javascript coder :)

Thanks much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant