In a feeble attempt to help out here I inserted below statement as line 228 in
io.jl (where blank lines are supposed to be removed)
println("chr: ", chr, " next chr: ", nextchr)
and a few lines down (in the beginning of the while loop):
println("Blank line found!")
Using an input file without a blank line following the # ... line
l1,l2
# ...
1,2
4,5
works fine:
julia> include("/Users/rob/.julia/v0.3/MCMCExampleRepository/test/test_df.jl")
chr: 108 next chr: 49
chr: 49 next chr: 44
chr: 44 next chr: 108
chr: 108 next chr: 50
chr: 50 next chr: 10
chr: 10 next chr: 35
chr: 49 next chr: 44
chr: 44 next chr: 50
chr: 50 next chr: 10
chr: 10 next chr: 52
chr: 52 next chr: 44
chr: 44 next chr: 53
chr: 53 next chr: 10
chr: 10 next chr: 255
2x2 DataFrame
|-------|----|----|
| Row # | l1 | l2 |
| 1 | 1 | 2 |
| 2 | 4 | 5 |
After inserting the blank line:
l1,l2
# ...
1,2
4,5
a "Blank line found" message never shows up. It almost seems the read_peek_eof
macro does not work correctly in this case.
The call to readtable() shows a line with a chr of 10 and a next chr of 35 (the
already removed '#'?):
julia> include("/Users/rob/.julia/v0.3/MCMCExampleRepository/test/test_df.jl")
chr: 108 next chr: 49
chr: 49 next chr: 44
chr: 44 next chr: 108
chr: 108 next chr: 50
chr: 50 next chr: 10
chr: 10 next chr: 35
chr: 10 next chr: 49
chr: 49 next chr: 44
chr: 44 next chr: 50
chr: 50 next chr: 10
chr: 10 next chr: 52
chr: 52 next chr: 44
chr: 44 next chr: 53
chr: 53 next chr: 10
chr: 10 next chr: 255
ERROR: BoundsError()
in findcorruption at /Users/rob/.julia/v0.3/DataFrames/src/dataframe/io.jl:670
in readtable! at /Users/rob/.julia/v0.3/DataFrames/src/dataframe/io.jl:732
in readtable at /Users/rob/.julia/v0.3/DataFrames/src/dataframe/io.jl:813
in readtable at /Users/rob/.julia/v0.3/DataFrames/src/dataframe/io.jl:880
in include at boot.jl:244
while loading /Users/rob/.julia/v0.3/MCMCExampleRepository/test/test_df.jl, in
expression starting on line 9
If I now remove the line with "# ..." a blank line is seen:
julia> include("/Users/rob/.julia/v0.3/MCMCExampleRepository/test/test_df.jl")
chr: 108 next chr: 49
chr: 49 next chr: 44
chr: 44 next chr: 108
chr: 108 next chr: 50
chr: 50 next chr: 10
chr: 10 next chr: 10
Blank line found!
chr: 49 next chr: 44
chr: 44 next chr: 50
chr: 50 next chr: 10
chr: 10 next chr: 52
chr: 52 next chr: 44
chr: 44 next chr: 53
chr: 53 next chr: 10
chr: 10 next chr: 255
2x2 DataFrame
|-------|----|----|
| Row # | l1 | l2 |
| 1 | 1 | 2 |
| 2 | 4 | 5 |
Rob J Goedman
[email protected]