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

stripwhitespace=true not removing trailing white space? #1076

Open
biona001 opened this issue Mar 17, 2023 · 1 comment
Open

stripwhitespace=true not removing trailing white space? #1076

biona001 opened this issue Mar 17, 2023 · 1 comment

Comments

@biona001
Copy link

biona001 commented Mar 17, 2023

On CSV v0.10.9, reading this file: https://bitbucket.org/nygcresearch/ldetect-data/src/master/EUR/fourier_ls-all.bed
with stripwhitespace=true doesn't seem to work as intended

julia> using CSV, DataFrames
julia> df = CSV.read("fourier_ls-all.bed", DataFrame, stripwhitespace=true)
julia> df[1, 1]
"chr1 "

Column 1 still has extra trailing white space?

@imyxh
Copy link

imyxh commented Oct 16, 2023

It seems like stripwhitespace does not work when the delimiter is itself a whitespace character.

Proof of concept:

julia> csv = "a\tb\tc  \n1\t2\t3"
"a\tb\tc  \n1\t2\t3"

julia> CSV.File(IOBuffer(csv), delim='\t', stripwhitespace=true)
1-element CSV.File:
 CSV.Row: (a = 1, b = 2, var"c  " = 3)

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

2 participants