I’d like to read every other (or every third, fourth,…) line from a text file into a variable.
function readtext(file)
lines = String[]
for line ∈ eachline(file)
push!(lines, line::String)
end
return lines
end
I’ve been doing this but thought I should be able to do some list comprehension after I open the file, maybe. Seems like there should be a much more elegant solution.
Any suggestions,
JB