This answer explains how to skip the first 5 lines of a file and read the following 5. But how do I skip a line when reading a file with Fortran if some condition is met, so that I don't know in advance which line I should skip? I wish a code that looks like this
OPEN(1,FILE='file.txt',STATUS='old')
DO
READ (1,*, END=10) a, b, c
IF(condition is true) THEN skip this line
ELSE do something
END IF
END DO
10 CLOSE(1)