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

Fails to convert certain string fields #8

Open
NewtrinoPiGui opened this issue Jan 17, 2020 · 0 comments
Open

Fails to convert certain string fields #8

NewtrinoPiGui opened this issue Jan 17, 2020 · 0 comments

Comments

@NewtrinoPiGui
Copy link

The field parsing seems to be a bit broken when parsing a CSV file. If a string field contains a " (quote followed by a space), the field is not properly terminated by a closing ' character. I ran into this issue where there are some text fields that refer to measurements like 1/2" and the SQL generated was improperly formatted. Here's an example:
14463,NULL,00536991501,INSULIN SYRINGE/NEEDLE (generic MONOJECT INSULIN SYRINGE),DOES NOT APPLY,MISC,MISC,28G X 1/2" 1 ML,97051030906370,INSULIN SYRINGE/NEEDLE,INSULIN SYRINGE/NEEDLE U-100,N,G,B,0,1,0
However, the SQL generated for this line is:
(14463,NULL,'00536991501','INSULIN SYRINGE/NEEDLE (generic MONOJECT INSULIN SYRINGE)','DOES NOT APPLY','MISC','MISC','28G X 1/2\" 1 ML,97051030906370,INSULIN SYRINGE/NEEDLE,INSULIN SYRINGE/NEEDLE U-100,N,G,B,0,1,0\n14464,NULL,00536993001,EASY TOUCH INSULIN SYRINGE,DOES NOT APPLY,MISC,MISC,31G X 5/16\" 1 ML,97051030906387,EASY TOUCH INSULIN SYRINGE,INSULIN SYRINGE/NEEDLE U-100,N,T,B,0,1,0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
Note that this is also including the following line, but the closing quotes enclose other fields. This appears to be an issue whenever quotes are escaped as part of the string, rather than enclosing a string field (that includes a comma). I suspect this is just being incorrectly parsed.

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