Data reading starting on a different row


yanuen
01-24-2008, 04:04 PM
Hi

I am trying to do a simple program to read a file and then give a different format to that file and write it into a new one, but the problem is that I want to start reading this file on the second row instead of the first row.

Does any one knows how to read data from let's say the second row or the fifth one instead of starting from the first row?

Thanks, I really appreciate your help

davekw7x
02-14-2008, 12:46 PM
...how to read data from...the fifth one instead of starting from the first row?

Thanks, I really appreciate your help

Am I missing something obvious about your problem? Just throw away the ones that you don't need.

.
.
.
INTEGER :: i, n
.
.
.

n = 4
open(7,file='test.dat',status='OLD')
write(*,*) 'Throwing away first ',n,' lines'
do i=1,n
read(7,*)
end do
write(*,*)'First pass: Here is line number ', n+1

! Now read and process the lines that you want to use
.
.
.


Regards,

Dave