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

Ability to specify a thousands separator character #626

Closed
jaakkor2 opened this issue May 4, 2020 · 9 comments · Fixed by #1093
Closed

Ability to specify a thousands separator character #626

jaakkor2 opened this issue May 4, 2020 · 9 comments · Fixed by #1093
Milestone

Comments

@jaakkor2
Copy link

jaakkor2 commented May 4, 2020

This feature was listed in #3 , but not implemented.

#207 has a complicated workaround (but keyword transforms does not exists anymore?), and says "there isn't a "thousands" separator option, but we could potentially add on".

Practical example, data is two first rows from table 2 on page 10 in https://www.istat.it/it/files//2020/05/Rapporto_Istat_ISS.pdf

a=CSV.File(IOBuffer("""
       Alessandria 95,7 98,2 -12,8 91,0 1.199 693 222 18,5
       Ancona 76,6 84,3 -10,7 49,4 704 528 86 12,2
       """), delim=" ", header = false, decimal = ',')

Row 1, column 6 would ideally be Int 1199. Here comma is a decimal separator and period is a thousands separator.

@quinnj quinnj added this to the 1.X milestone Jun 26, 2020
@pdeffebach
Copy link

Bumping this. We are working on a package to make it easier to copy and paste from Excel and using CSV as the backend.

I have a feeling there are a lot of excel workbooks where the data is stored as a number, shown with commas, and then when you copy and paste the commas are retained. This is how google sheets work at least.

@lungben
Copy link
Contributor

lungben commented Jun 28, 2021

This feature would be useful for me, too.

@mkborregaard
Copy link

This would be really useful for me too

@LilithHafner
Copy link
Contributor

Bump, I'm also running into this issue.

My workaround is to parse normally and then post-process with parse(Float64, replace(string(x), ',' => ""))

@quinnj
Copy link
Member

quinnj commented Dec 19, 2022

Hmmm, @Drvi, where did we land on this? We added support in Parsers.jl, but did we plumb the functionality through CSV.jl? It should be pretty easy to support in CSV.jl now that it's supported in Parsers.jl. (just need to plumb through the groupmark keyword arg to the Parsers.Options constructor)

@Drvi
Copy link
Collaborator

Drvi commented Dec 19, 2022

@quinnj Yeah, things should be ready in Parsers.jl. Only single-byte groupmarks are supported.

@bkamins
Copy link
Member

bkamins commented Feb 5, 2023

bump

@AndreasKuhn-ak
Copy link

Bump

@LilithHafner
Copy link
Contributor

Huzzah!

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

Successfully merging a pull request may close this issue.

10 participants