Reading from a file in a script

zilore mumba zmumba at YAHOO.COM
Fri Oct 17 05:08:51 EDT 2008


Dear Christoph,
Thanks for your time. It works perfect
Good day
Zilore Mumba




--- On Thu, 10/16/08, Stegert <stegert at IFM.UNI-HAMBURG.DE> wrote:

From: Stegert <stegert at IFM.UNI-HAMBURG.DE>
Subject: Re: Reading from a file in a script
To: GRADSUSR at LIST.CINECA.IT
Date: Thursday, October 16, 2008, 9:01 PM

Dear Zilore Mumba,

As far as I know grads expects to put the information
from READ into a file, i.e.
var = read(date_file.txt)

should work followed by
say sublin(var,2)

The same is with the CLOSE function which should be
dum = close(date_file.txt)
(dum is not further needed but must be used to
avoid an error).

Best regards,
Christoph

zilore mumba schrieb:
> Help sought please,
> I have a file generate by a perl script, containing only the current
> date, written as, e.g.: 16/ 10/ 2008.
>
> I am trying to read from this file in my grads script. Here is the
> script I wrote:
> read(date_file.txt)
>
> say sublin(result,2)
>
> Day=sublin(result,2)
> Month=sublin(result,3)
> Year=sublin(result,4)
>
> 'draw title Valid on:  'Day' 'Month' 'Year
>
> According to the Grads documentation, the first record of this read
> statement is a return error, and I can recover the records from 2 and
> repeatedly reading for subsequent records.
>
> I do not get beyond the first line of my script, geeting error 1, which
> is an open error.
> I have not seem a single script which reads from a file.
> Does the read function actually work, or where is my error?
>
> Assistance appreciated
> Zilore Mumba
>
>

--
Christoph Stegert:  Ecological Modelling group
Institut für Meereskunde - Universität Hamburg, Germany
Zentrum f. Marine u. Atmosphärische Wissenschaften ZMAW
Bundesstr.53, 20146 Hamburg - Phone: +49-40/ 42838-7486


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20081017/89279825/attachment.html 


More information about the gradsusr mailing list