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

Double Colon "::" in First Column Confuses CSV #175

Open
jeetsukumaran opened this issue Oct 16, 2020 · 3 comments
Open

Double Colon "::" in First Column Confuses CSV #175

jeetsukumaran opened this issue Oct 16, 2020 · 3 comments

Comments

@jeetsukumaran
Copy link
Contributor

Given a file double colon characters in the first field, e.g.

col1::col1cont,col2,col3a::col3b::col3c,col4
col1::col1cont,col2,col3a::col3b::col3c,col4

I would expect to see:

col1::col1cont|col2|col3a::col3bcol3c|col4
col1::col1cont|col2|col3a::col3bcol3c|col4

However, this plugin produces:

 col1| | col1cont,col2,col3a| | col3b| | col3c,col4
 col1| | col1cont,col2,col3a| | col3b| | col3c,col4
 col1| | col1cont,col2,col3a| | col3b| | col3c,col4
 col1| | col1cont,col2,col3a| | col3b| | col3c,col4

It seems to interpret the colon as field delimiters and ignores the comma.

Same if there tabs in the file. In more complex files, it gets really confused, respecting some commas/tabs as field delimiters and ignoring others.

@chrisbra
Copy link
Owner

chrisbra commented Nov 4, 2020

I think this happens, because the plugin is trying to guess the default delimiter. And : is also checked and it occurs more often than the comma, so the plugin uses this.

Use

:let g:csv_default_delim=','

to specify the default delimiter.

@jeetsukumaran
Copy link
Contributor Author

Is it possible to restrict the default delimiters (e.g., only check for ',' and '\t')?

@chrisbra
Copy link
Owner

chrisbra commented Nov 5, 2020

I don't think this is currently possible.

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