May 10, 2009 #1 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?
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?
May 10, 2009 1 #2 gullipe Programmer Oct 5, 2006 139 IS 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) Upvote 0 Downvote
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)