Perform a read operation before the do loop, which reads everything on the first line into the "dummy" variable.
program linereadtest implicit none character (LEN=75) ::firstline integer :: temp,n ! ! ! open(18,file='linereadtest.txt') read(18,*) firstline do n=1,4 read(18,'(i3)') temp write(*,*) temp end do stop end program linereadtest
Datafile:
This is a test of 1000 things, 10 of which do not exist
50 100 34 566
! ignore the space between the string and the numbers, I can not get it to format
source share