[gradsusr] Error in saving output to text
Ipshita Majhi
ipmajhi at alaska.edu
Wed Sep 24 00:34:24 EDT 2014
Dear Grad Users
I want to save a variable as a text file. I am not able to do that using
the code below it just gives the name of the variable as the output. How do
I ensure that proper values get stored in the output file.
Thank You
Ipshita
'open prec.mean.imr.ctl'
file = 'my_ascii_file.txt'
datafile = 'precp.mean.imr'
'set gxout fwrite'
' set t 1 40177' * This is the time variable
'set fwrite -ap 'datafile
'!/bin/rm -f 'datafile
while (1)
res = read(file)
line1 = sublin(res,1)
line2 = sublin(res,2)
rc1 = subwrd(line1,1)
if (rc1); break; endif
val = subwrd(line2,1)
'd 'val
endwhile
rc = close(file)
'disable fwrite'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140923/645c734b/attachment.html
More information about the gradsusr
mailing list