<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Dear Christoph,</DIV>
<DIV>Thanks for your time. It works perfect</DIV>
<DIV>Good day</DIV>
<DIV>Zilore Mumba</DIV>
<DIV><BR><BR><BR><BR>--- On <B>Thu, 10/16/08, Stegert <I><stegert@IFM.UNI-HAMBURG.DE></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Stegert <stegert@IFM.UNI-HAMBURG.DE><BR>Subject: Re: Reading from a file in a script<BR>To: GRADSUSR@LIST.CINECA.IT<BR>Date: Thursday, October 16, 2008, 9:01 PM<BR><BR><PRE>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
</PRE></BLOCKQUOTE></td></tr></table><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com