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

Do not convert quoted cells #1086

Open
olivierlabayle opened this issue May 5, 2023 · 0 comments
Open

Do not convert quoted cells #1086

olivierlabayle opened this issue May 5, 2023 · 0 comments

Comments

@olivierlabayle
Copy link

Hi,

I think CSV.jl automatically detects and converts quoted cells to the detected type. When writing, one can specify quotestrings=true in order to keep the quotes. Unfortunately I don't think I can find a way to have the same behaviour at read time. For instance, in the following scenario I'd like to keep the A column as String since it is quoted but can't find a way to do it. I was looking for something like quotedasstring argument but can't find anything like it.

using CSV
using DataFrames

CSV.read(
    IOBuffer("""
    A,B
    "1001","a"
    "0002","b"
    """),
    DataFrame,
    typemap=Dict(String => String)
)

Is there a way to still achieve this or would it be possible in the near future? I know I could use the types=Dict(:A => String) unfortunately I can't really know that in advance.

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