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

Text deliminator #9

Closed
js333031 opened this issue Sep 9, 2016 · 1 comment
Closed

Text deliminator #9

js333031 opened this issue Sep 9, 2016 · 1 comment

Comments

@js333031
Copy link

js333031 commented Sep 9, 2016

I have a csv file where some cells contain text string, like the example below.

Three cells:
previous cell data, "abcd, efg", next cell data

The second column has a quoted string with comma as part of the text. This causes termsql to create 4 columns where 2nd column is "abcd and 3rd column is efg"

Is there an termsql option that can use both the cell deliminator and text deliminator?

@tobimensch
Copy link
Owner

tobimensch commented Sep 10, 2016

There's an option for using regex as a delimiter. (-g) Though possible, I guess it's not trivial to develop the correct regex for splitting a csv line with quoted strings.

I just added a new option (--csv) to termsql. If you use that, termsql uses python's csv parser using " as the quote char and , as the delimiter. You can still change the delimiter to something else if you like though.

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

2 participants