CSV.jl
CSV.jl copied to clipboard
Ability to specify a thousands separator character
This feature was listed in https://github.com/JuliaData/CSV.jl/issues/3 , but not implemented.
https://github.com/JuliaData/CSV.jl/issues/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.
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.
This feature would be useful for me, too.
This would be really useful for me too
Bump, I'm also running into this issue.
My workaround is to parse normally and then post-process with parse(Float64, replace(string(x), ',' => ""))
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)
@quinnj Yeah, things should be ready in Parsers.jl. Only single-byte groupmarks are supported.
bump
Bump
Huzzah!