[gradsusr] opening text file data

Muhammad Rahiz muhammad.rahiz at ouce.ox.ac.uk
Mon Feb 7 11:31:39 EST 2011


James, you can try the following.

*****

'sdfopen ifile.nc'

* ttot = number of lines in text file
ttot = 755
tx = 1
while(tx<=ttot)
fname ='7hA01.out.txt'
  rec = read(fname)
  IO = sublin(rec,1)
   if(IO = 1)
    say fname' > File open error'
    'quit'
   endif
  if(IO = 0)
    t1 = subwrd(rec,2)
    t2 = subwrd(rec,3)
   endif
say ''t1' 't2''

tx = tx +1
endwhile

*****

-- 
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford

On Mon, 7 Feb 2011, James Ciarlo` wrote:

> Hi,
> I have several text files such as the one I attached and I need to open them
> which GrADS but I cannot understand how to do so. Can someone help me
> please?
> 
> James
> 
>



More information about the gradsusr mailing list