If you are wanting to read from the beginning of CoOrd.txt
each time through the outer loop, then you need to rewind CoOrd.txt
each time through the loop:
Integer ReadStat
...
Do n=1,10
Read (2, '(1x,a6,5x,i5,7x,i4,i8,i8,i8,i8)', IOSTAT=ReadStat) NodeID,AAA,BBB,CCC,DDD,EEE,FFF
If (ReadStat < 0) exit ! EOF reached
If (ReadStat > 0) stop ! An unknown error occurred
write (4,*)NodeID,DDD
rewind(12)
Do J=1,10
READ (12, ('(1x,a4,7x,I5,8x,f8.2,f8.2,f8.2)', IOSTAT=ReadStat))Line,AA,BB,CC,DD
If (ReadStat < 0) exit ! EOF reached
If (ReadStat > 0) stop ! An unknown error occurred
write (4,*) Line,AA
End Do
End Do