readdlm interprets data imported form a .dat text file as:
julia> A
2×4 Matrix{Any}:
1 2 "" 3
4 5 6 ""
I would like to ignore the ""SubString{String} and raster by row to obtain the following final vector:
6-element Vector{Float64}:
1
2
3
4
5
6
Things I’ve Tried:
Transpose ' of the data won’t work because typeof(A) is Matrix{Any}.
deleteat!(data .== "") also won’t work for the same reason.
I also tried creating a new array B containing only the Floats of A, but that didn’t work because it rasters by columns, even if I initialize B as a matrix:
To explain why this works (as it may not be obvious): in julia, numbers are iterable and have a length of 1. Thus, isempty(3) is false and it doesn’t get filtered out, in contrast to isempty(""), which is true and gets removed.