-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
ERROR: CSV parse error #14
Comments
Having this feature would be awesome. |
If you get a chance, could you try out my PR to see if it solves your problem? |
Any chance the PR from @mikecoop83 gets merged? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to diff two CSV files and csv-diff just responds with:
So I do the same things using it as a python package (that is I write a Python script that loads my two files and runs csv--diff on them as per the README) and I get a different error:
Double check the key and it is there, as column 1 in the files which load fine in LibreOffice Calc and in Excel and look fine in a text editor.
So I look at the the file encoding and Python's magic library tells me:
'UTF-8 Unicode (with BOM) text, with very long lines, with CRLF line terminators'
so if I open the file with an encoding of "utf-8-sig" all works fine.
Seems to me, to be a file encoding issue, and one I have encountered in Python a lot so I wrote this:
and then if I run:
all is good and I get a reliable diff.
I can't work out how to debug the CLI interface in PyDev alas. I'm a tad green in this space it seems. But
setup.py build
just creates a build folder with a lib folder with__init__.py
andcli.py
in it. Yet my Windows box (man I hate Windows but I'm stuck there right now) runs a csvdiff.exe which was presumably installed by pip when I installed csv-diff (pip install csv-diff
). But I can't see how to run the CLI interface from the source. Guess I could do some reading on click and setup-tools, but hey for the moment, I have it working via its Python package interface and can run with that.If the CLI error is in fact related to this encoding issue (hard to know for sure), then it could of course be fixed by including an encoding check as above and opening the files with their appropriate encoding. Frankly it'd be nice if python's
open()
could better guess the encoding (the way magic can).The text was updated successfully, but these errors were encountered: