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

importing csv with commas #422

Closed
rfdrake opened this issue Aug 3, 2016 · 1 comment
Closed

importing csv with commas #422

rfdrake opened this issue Aug 3, 2016 · 1 comment
Labels
type: feature Introduction of new functionality to the application

Comments

@rfdrake
Copy link
Contributor

rfdrake commented Aug 3, 2016

Site names with a comma cannot be imported. As a workaround for just a handful of sites you can remove the comma and then edit the site to put it back. Unfortunately I've got 166 of them so I may need to do some hacking to workaround it.

I tried escaping the commas with , and tried quoting the columns. Both produced errors.

I'm not very knowledgeable of python but it looks like there is a core csv parser that could be used that supports quoting. I tried making naive changes to replace row.strip().split(',') with csv.reader(row), but I'm not sure how to write a unit test to make sure that would work.

@jeremystretch jeremystretch added the type: feature Introduction of new functionality to the application label Aug 3, 2016
@jeremystretch
Copy link
Member

jeremystretch commented Aug 3, 2016

Implemented Python's built-in CSV reader to support double-quoting values. For example:

"New York, NY",new-york-ny,Other stuff

becomes

['New York, NY', 'new-york-ny', 'Other stuff']

if-fi pushed a commit to if-fi/netbox that referenced this issue Oct 1, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants