Answers for "read line from file fortran"

1

read line from file fortran

integer :: stat
    character(len=200) :: line

    open (1, file='data.dat', status='old')  ! can not have unit=6

    do
        read(1, '(A)', IOSTAT=stat) line
        if (IS_IOSTAT_END(stat)) exit
        print *, line
    end do

    close (1)
Posted by: Guest on February-01-2022

Browse Popular Code Answers by Language