Skip to content
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

First quoted fieldname keeps quotes in key #81

Open
tanj opened this issue Aug 23, 2017 · 1 comment
Open

First quoted fieldname keeps quotes in key #81

tanj opened this issue Aug 23, 2017 · 1 comment

Comments

@tanj
Copy link

tanj commented Aug 23, 2017

A utf-8 csv file (in my case: utf-8-with-signature-dos [according to emacs]) with quoted header fields like

"column1", "column2", "column3"

Generate a fieldnames list like

[u'"column1"', u'column2', u'column3']

I would expect all of the field names to have the quote character stripped.

I'm guessing this is due to the BOM being present and messing up the process that gets the headers

@ghost
Copy link

ghost commented Feb 14, 2018

When I stripped the BOM from the csv, the field names were correct. Now there are three people who run into this problem (see: https://stackoverflow.com/questions/42991188/how-can-i-remove-the-quote-characters-from-the-first-field-name-when-unicodecsv)
In my case I intended to use the unicodecsv.DictReader but with this behavior I need to watch out for an alternative. Unfortunately I am not skilled enough to propose a solution - other than the workaround posted in the link above.

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