<div dir="ltr"><div><div>Dear Grad Users<br><br></div>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.<br></div>Thank You<br>Ipshita<br><div><br>&#39;open prec.mean.imr.ctl&#39;<br><br>file = &#39;my_ascii_file.txt&#39;<br>datafile = &#39;precp.mean.imr&#39;<br>&#39;set gxout fwrite&#39;<br>&#39; set t 1 40177&#39; * This is the time variable<br>&#39;set fwrite -ap &#39;datafile<br>&#39;!/bin/rm -f &#39;datafile<br>while (1)<br>  res = read(file)<br>  line1 = sublin(res,1)<br>  line2 = sublin(res,2)<br>  rc1 = subwrd(line1,1)<br>  if (rc1); break; endif<br>  val = subwrd(line2,1)<br>  &#39;d &#39;val<br>endwhile<br>rc = close(file)<br>&#39;disable fwrite&#39;<br><br></div></div>