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

Added changes to support site and element names containing commas. #1

Merged
merged 4 commits into from
Aug 2, 2019

Conversation

ktanushree
Copy link
Contributor

A comma in the site name or element name would "corrupt" the CSV file. Made minor change to replace comma with a space if present in the site or element name

@ebob9
Copy link
Owner

ebob9 commented Aug 2, 2019

Actually, this isn't the right way to fix this, unfortunately.

When I wrote this (a long time ago), I didn't use the csv writer libraries because I wanted to write line-by-line. So I wrote my own.

Since then, I've learned that all lines in a CSV should be quoted to allow commas/etc. The right fix is to update the CSV writer to always write comma lines.

Take a look at:

write_str = '{0},{1},{2},{3},="{4}",{5},{6},{7},{8},{9},' \

You can see there a couple values I used ="{4}". I believe if we change all of the vars to be encapsulated like that, quote names will "work correctly",

@ebob9 ebob9 added the bug label Aug 2, 2019
Made edits to write_to_csv function - variable now enclosed in double quotes.
@ebob9 ebob9 merged commit 55f990b into ebob9:master Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants