[gradsusr] how to put the output numbers in an excel or a text file

Ricardo Hallak hallak at model.iag.usp.br
Mon Feb 11 10:50:35 EST 2013


Dear T.,
try this:

'reinit'
'open E:\test.ctl'
'set t 1'
'set lat 10'
'set lon 135'
'define r1= sst'
'set t 2'
'set lat 20'
'set lon 100'
'define r2= sst'
'define aver= (r1+r2)/2'
'd aver'
newvar=subwrd(result,4)
res=write('filename.txt',newvar,append)
'quit'

Hope this helps.
Ricardo

On Mon, 11 Feb 2013 13:04:58 +0000, T. haghroosta wrote
>  
> 
> 
> Dear All,
>  
> I wrote this script and I would like to see the amount of "aver" as an output in a .txt  or .xls file. Could you please help me?
>  
> 'reinit'
> 'open E:\test.ctl'
> 'set t 1'
> 'set lat 10'
> 'set lon 135'
> 'define r1= sst'
> 'set t 2'
> 'set lat 20'
> 'set lon 100'
> 'define r2= sst'
> 'define aver= (r1+r2)/2'
> 
>  Regards,
>  
> T.
>  
> 
> > Dear All, I have a script to calculate the average of different groups of numbers. How can I show the outputs of the script running, contain numbers, in an excel or a text file? Regards, T. 
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130208/ca3e352a/attachment-0001.html 
> > 
> > ------------------------------
> > 
> > Message: 2
> > Date: Fri, 8 !Feb 2013 10:37:44 -0200
> > From: RafaelCB <rafael.ciram at gmail.com>
> > Subject: Re: [gradsusr] how put the output numbers in an excel or a
> > text file
> > To: GrADS Users Forum <gradsusr at gradsusr.org>
> > Message-ID:
> > <CAAgZ0pL8bQHs235nXYfTZzKJwEj1uPot9PrUbnz2evQGQowCAA at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> > 
> > An example follows:
> > 
> > 'd gr2stn(rh.1,min.2)'
> > rh=sublin(result,_n2)
> > 'd gr2stn(u10.1,min.2)'
> > u1=sublin(result,_n2)
> > '!echo 'dia','hora','_sig','lo','la','rh','u1' | sed s@\ @@g >> verific.dat'
> > 
> > I have helped.
> > 
> > Regards.
> > -- 
> > *Rafael Censi Borges
> > Meteorologia - Epagri/Ciram
> > +55 (48)3665-5130
> > http://ciram.epagri.sc.gov.br*
> > 
> > 
> > 2013/2/8 T. haghroosta <haghroosta at hotmail.com>
> > 
> > > Dear All,
> > >
> > &g!t; I have a script to calculate the average of different groups of numbers.
> > > How can I show the outputs of the script running, contain numbers, in an
> > > excel or a text file?
> > >
> > > Regards,
> > >
> > > T.
> > >
> > > _______________________________________________
> > > gradsusr mailing list
> > > gradsusr at gradsusr.org
> > > http://gradsusr.org/mailman/listinfo/gradsusr
> > >
> > >
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130208/d9812b61/attachment-0001.html 
> > 
> > ------------------------------
> > 
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> > 
> > 
> > End of gradsusr Digest, Vol 36, Issue 38
> > ****************************************
>

Ricardo Hallak

Departamento de Ciências Atmosféricas (ACA) 
Instituto de Astronomia, Geofísica e Ciências Atmosféricas (IAG) 
Universidade de São Paulo (USP) 
Rua do Matão, 1226 - Cidade Universitária - São Paulo SP 05508-900 
Phone.: +55 (11) 3091-2850; 3091-4703 
Fax: +55 (11) 3091-4714

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130211/dee40dd3/attachment-0003.html 


More information about the gradsusr mailing list