ASCII out yyyy-mm-dd (Numeric Month)
Jae H Ryu
jhryu at U.WASHINGTON.EDU
Mon Apr 23 16:41:45 EDT 2007
Hi Users,
I have digged out the Listserve but coudn't get the answer yet.
My goal is to print data set look like this.
date value
1995-01-01 0.123
1995-01-02 0.345
1995-01-03 0.123
rather than,
1995-JAN-01 0.123
1995-JAN-02 0.345
1995-JAN-03 0.123
but, GRAD always return the name of month (e.g. Jan, Feb, Mar..) rather
than numeric value (e.g.01, 02, 03..)
If anyone knows how to handle this problem, please let me know.
I attached a script below.
'reinit'
'open narr-a.ctl'
### Assign lon,lat to met stations ###
timeend = 1000
i = 1
while(i <= timeend)
'set t 'i''
'q time'
timehr = substr(result, 8, 3)
timedy = substr(result, 11, 2)
timemo = substr(result, 13, 3)
timeyr = substr(result, 16, 4)
'd pevapsfc'
a.nr = subwrd(result,10)
val = timeyr%"-"%timemo%"-"%timedy"-"%timehr" "%a.nr
rec = write('pevapsfc.txt',val, append)
i = i + 1
endwhile
More information about the gradsusr
mailing list