Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

test.....................................

program instruens_fabulam
  implicit none  

  ! the variables
  integer stat
  character(79) :: line

  ! this opens the input file
  open (25, file='text.txt', status='old', iostat=stat)


  ! this opens the output file
  open (50, file='outtext.txt', status='unknown', iostat=stat)


  ! runs file
  do while (.true.)
    read (25, '(A)', end=79) line ! reads input line
    write(*, '(80A)') line        ! writes line to the screen
	
    write(50, '(A)') trim(line)   ! writes line to output file, removes trailing characters
    
    
  enddo
  
  ! this closes the files
  79 continue
  close (25)
  close (50)
    
end program instruens_fabulam

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.