Hello
I am learning Fortran and I am currently trying to write a program that reads a text-file and prints it on the screen. The problem I am having is that all blank lines are skipped.
I get this on the screen:
****.123
******.abc
****.txt
Instead of this:
****.123
******.abc
****.txt
Here is my program for reference.
---------------------------------------------------
Program quad
integer i, j
character a*30
OPEN (4, FILE='test.txt', STATUS='old')
do 20
read(4,*, end=10) a
write(*,*) a
a=''
20 continue
10 stop
end
---------------------------------------------------
Any tips are appreciated!
I am learning Fortran and I am currently trying to write a program that reads a text-file and prints it on the screen. The problem I am having is that all blank lines are skipped.
I get this on the screen:
****.123
******.abc
****.txt
Instead of this:
****.123
******.abc
****.txt
Here is my program for reference.
---------------------------------------------------
Program quad
integer i, j
character a*30
OPEN (4, FILE='test.txt', STATUS='old')
do 20
read(4,*, end=10) a
write(*,*) a
a=''
20 continue
10 stop
end
---------------------------------------------------
Any tips are appreciated!