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

Autodetect delimiter in CSV files #80

Closed
jeanferri opened this issue Sep 11, 2015 · 6 comments
Closed

Autodetect delimiter in CSV files #80

jeanferri opened this issue Sep 11, 2015 · 6 comments

Comments

@jeanferri
Copy link
Contributor

Currently the import_from_csv method have the parameter 'delimiter' that assumes ',' as default, but sometimes we don't know what is the delimiter and need it autodetect. Specially usefull in case of CSV files generated in MS Excell that uses ';' as delimiter.

A quick and dirty possibility to make this works is counting the number of times ',', ';' and 'tab' is used in the file and assumes as delimiter the most used.

@turicas
Copy link
Owner

turicas commented Sep 11, 2015

Good one, @jeanferri! :-)
We can use csv.Sniffer to detect it (it implements what you suggested already).
Feel free to send a PR if you have time available for this task.

@turicas turicas added this to the Version 0.2.0 milestone Sep 11, 2015
@turicas
Copy link
Owner

turicas commented Sep 11, 2015

Note that you can pass delimiter and quotechar manually to import_from_csv.

@jeanferri
Copy link
Contributor Author

Ok, I'll try it tomorrow and in case of success I will send you a PR...

@turicas
Copy link
Owner

turicas commented Oct 6, 2015

@jeanferri, did you have time to work on this issue?

@jeanferri
Copy link
Contributor Author

Not yet but will... First I have to fix some urgent bugs in Portal Modelo transparency module...

@turicas
Copy link
Owner

turicas commented Oct 6, 2015

Ok. If I may help in any way, please ask. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants