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

Support empty string delimiter #748

Closed
guyvdbroeck opened this issue Oct 10, 2020 · 1 comment
Closed

Support empty string delimiter #748

guyvdbroeck opened this issue Oct 10, 2020 · 1 comment

Comments

@guyvdbroeck
Copy link

I have data files that don't have any delimiter: each character is its own column.
It would be great if CSV.jl could support empty string delimiters: CSV.File("data.txt"; delim="")
Currently it puts the entire row string into one column.

@quinnj
Copy link
Member

quinnj commented Oct 21, 2020

I'm not sure I really see the value of using CSV.jl here, when it seems like all you need is something like:

open(file) do io
    line = readline(io)
    cols = [[line[i]] for i = 1:length(line)]
    for line in eachline(io)
        for i = 1:length(line)
            push!(cols[i], line[i])
        end
    end
end

But perhaps if we come up with some kind of API/framework for more general fixed width parsing, it could help here; I'm going to close for now as a duplicate of #601 . Feel free to comment here with other questions or to walk through your use-case in more detail if I'm misunderstanding something here.

@quinnj quinnj closed this as completed Oct 21, 2020
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