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

readdlm trailing whitespace #5602

Closed
visr opened this issue Jan 29, 2014 · 0 comments
Closed

readdlm trailing whitespace #5602

visr opened this issue Jan 29, 2014 · 0 comments

Comments

@visr
Copy link
Contributor

visr commented Jan 29, 2014

The default readdlm now treats multiple whitespace separators as one, and ignores leading and trailing whitespace. But this seems not to be the case for trailing whitespace after the last data line.

Hence these work:

readdlm(IOBuffer("  1  2  \n  3  4  "))
readdlm(IOBuffer("  1  2  \n  3  4\n"))

However if I put any whitespace directly before or after the final \n of the second example, I get the following error:

readdlm(IOBuffer("  1  2  \n  3  4 \n"))
ERROR: BoundsError()
 in dlm_offsets at datafmt.jl:201

Therefore a delimited file ending with \r\n will fail, which was my use case. But perhaps in general all trailing whitespace should be allowed and ignored?

julia> versioninfo()
Julia Version 0.3.0-prerelease+1286
Commit bedfe12* (2014-01-28 21:18 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-3360M CPU @ 2.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

ref #5391

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