Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format problem 1

Status
Not open for further replies.

TheKKK

Technical User
Mar 21, 2009
10
GR
What is the best way of reading a line like that:

02.01.2003 00:00 35.0

The following format doesnt work:

FORMAT(I2, '.', I2, '.', I4, I2, ':', '00', F7.1)

It gives a runtime error:
Constant string in input format

for the '.'

What is the problem with this?
 
Hi TheKKK

You can do this in two ways:

character*1, x1,x2,x3,x4
integer*4 da,ma,ye,mi,se
real*4 fig

read (1,100) da,x1,ma,x2,ye,x3,mi,x4,se,fig
100 format(i2,a,i2,a,i4,a,i2,a,i2,f12.1)

... or ...

read (1,100) da,ma,ye,mi,se,fig
100 format(i2,1x,i2,1x,i4,1x,i2,1x,i2,f12.1)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top