Skip to content

readdlm not working with white spaces #1

@cdelv

Description

@cdelv

readdlm ignores all-white spaces by default when a delimiter is not specified. However, when one wants to specify the data type to be read it is obligatory to specify the delimiter too...

readdlm(source, delim::AbstractChar, T::Type, eol::AbstractChar; header=false, skipstart=0, skipblanks=true, use_mmap, quotes=true, dims, comments=false, comment_char='#')

Then, in the following case,

readdlm(file, ' ', Float64, comments=true)

the function doesn't ignore the initial whitespace because the delimiter is ' ', only 1 whitespace. Then the program crashes with for example

 2 3
1 3

There should be a flag to ignore all chars that match with the delimiter or just be able to specify the type like this

readdlm(file, type=Float64, comments=true)

however this brings the problem that if the delimiter is not a whitespace the problem will persist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions