ascii file

Francis P A francis at CAOS.IISC.ERNET.IN
Wed Feb 16 03:42:33 EST 2005


Hi Martine
 What Mallikarjun suggested was to write out a binary file only. I saw a
reply for your mail by Prince Xavier, which will write out the ascii file.
Accedently I deleted your mail; but what I remember is that you need to
write-out a variable of 12 time steps into an ASCII file.

You can use either  method Prince suggested or use a 'print' statement as
follows.

'set t 1 12'
'set gxout print'
'set prnopts %6.2f 12'
** to define the format of output
'd myvariable'
say result
l1=sublin(result,2)
write ('myfilename.txt',l1)
yr=yr+1
endwhile

Hope this will help you

Francis

On Tue, 15 Feb 2005, Martine Michou wrote:

> Mallikarjun wrote:
> > Hello Martine Michou,
> >
> > Use 'fwrite' command as follows:
> >
> > 'set fwrite <file name.dat>' *** give file name there 'set gxout
> > fwrite' 'd <variable>'  *** Enter the variable ***
> >
> >
> > To check the .dat file you must quit the grads.
> >
> > Try it out....
> >
>
>
>
> Thanks for your response.
>
> However, I cannot read the file file name.dat with a simple more file
> name.dat or vi file name.dat command.  Apparently the file I generate is
> a binary file and not an ASCII file.
>
> Any suggestion?
>
> Thank you.
>
> Martine Michou
> ~~

--
Francis P A
Centre for Atmospheric and Oceanic Sciences
Indian Institute of Science
Bangalore, INDIA.
PHONE: 91-80-22932505 or 23600450
FAX:   91-80-23600865
email:francis at caos.iisc.ernet.in
http://caos.iisc.ernet.in/hpg/students/francis.html



More information about the gradsusr mailing list