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

trouble reading .csv file when Excel is running in FR locale #16

Open
jbnivoit opened this issue Oct 2, 2024 · 0 comments
Open

trouble reading .csv file when Excel is running in FR locale #16

jbnivoit opened this issue Oct 2, 2024 · 0 comments

Comments

@jbnivoit
Copy link

jbnivoit commented Oct 2, 2024

csv_reader = csv.DictReader(file)

this line needs to be adjusted with "csv.DictReader(file, delimiter=';')" since the delimiter in CSV in this situation is not (confusingly) a comma but a semicolon. I don't think this needs to be fixed, I am just leaving it here in case someone else needs to make the same adjustment.

Finally in numeric values in French locale, the "." is really emitted as a comma, so one needs to mass-replace "," with ".".

Similarly, if you see errors such as :

ValueError: could not convert string to float: '\u202f12320'

that is because the thousand separator is \u202f ("_"), so one needs to edit the file to remove those characters.

Once these 3 issues are adressed, it is possible to run the tool with the CSV file.

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