Prova così

codice:
open "file.dat" for input as #1

do while not eof(1)

line input, dati

if dati = 3 then
'fai quello che vuoi
end if

loop