Reading a file with blank last line

I made a code for a problem that gets its inputs from a file. The inputs are integers and the last line is blank. Below are the ones I’ve tried.

for line in eachline()
    isempty(strip(line)) && break
    n = parse(Int, line)
for line in Iterators.takewhile(x -> !isempty(strip(x)), eachline())
    n = parse(Int, line)

Are there better alternatives? I like ‘takewhile’ but it’s noticeably slower than the first.

I would probably do something like:

for line in Iterators.filter(x -> !isempty(x), eachline())

Unless an empty line in the middle of the file signifies the end of the data.