[gradsusr] Writing data text file

Menaka Revel menakarevel at yahoo.com
Fri Oct 17 14:48:15 EDT 2014


Hi,

  Someone please help me to correct the script written to get the data into text file. Following (no 1) script is used to get the text file but the problem is it did not break lines. The output file is attached as text file, it should be like under no 2

no 1: script
....................................................................

'open DM02_M.ctl'

'set dbuff on'

'set t 24'



outfile='arain_1.txt'

'!/bin/rm -f 'outfile
'set gxout print'

'set prnopts %10.3f 1 1'

'd lon'
lon_data = result

'd lat'
lat_data = result

'd rainc(t+24)+rainnc(t+24)-rainc-rainnc'
v1_data = result

i=1
while (i<100)


  lons  = sublin(lon_data,i)
  lats  = sublin(lat_data,i)
  line1 = sublin(v1_data,i)


if (lons='' | lats='' | line1=''); break; endif


if (i>1)

rc = write(outfile,lons' 'lats' 'line1,append)
      
endif

i=i+1

endwhile
..................................................................

no 2: Needed output

79.393       7.414       5.688 
    
79.442       7.414       7.454 
    
79.491       7.414      21.994 
    
79.541       7.414      32.329 
    
79.590       7.414      30.025 
    
79.639       7.414      19.323 
    
79.689       7.414       5.054 
    
79.738       7.414       2.902 
    
79.787       7.414       0.208 
    
79.836       7.414       3.580 
    
79.886       7.414       6.208 
    
79.935       7.414      13.869 
    
79.984       7.414       8.350 
    
80.034       7.414      11.248 
    
80.083       7.414      13.321 
    
80.132       7.414      14.315 
    
80.181       7.414      16.263 
    
80.231       7.414      19.770 
    
80.280       7.414      20.056 
    
80.329       7.414      30.902 
    
80.379       7.414      32.377 
    
80.428       7.414      38.517 
    
80.477       7.414      43.332 
    
80.527       7.414      45.161 
    
80.576       7.414      45.874 
    
80.625       7.414      42.580 
    
80.675       7.414      34.532 
    
80.724       7.414      25.229 
    
80.773       7.414      15.317 
    
80.822       7.414      13.750 
    
80.872       7.414      15.803 
    


 
Regards,

Menaka Revel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20141017/8c3906a7/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: arain_2.txt
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20141017/8c3906a7/attachment.txt 


More information about the gradsusr mailing list