text processing



Can anyone tell me how one can find the end of a line of text that comes from a sequential file in f77? The trailing blanks when reading a line is annoying, for instance

c234567
character*80 line
open(1,file='data.txt')
read(1,1)line
1 format(a)
stop
end

where the data in the text file is

abcde

and the rest is just blank, or sometimes, the line is longer than 'line' and just gets truncated...

I want to find the end of the line without the truncation, is there a way to do it?

Many thanks.

Dyl.

.