[gradsusr] Error opening .txt file in a grads script

Jeff Duda jeffduda319 at gmail.com
Mon Nov 30 13:16:24 EST 2015


The snippet of script code you included isn't consistent with the output
you included. I can't see from what you included what would be the cause of
the error. Do you have non-alphanumeric characters in your text file?
Otherwise I suspect you have a syntax error in your script somewhere else.

Jeff Duda

On Mon, Nov 30, 2015 at 10:36 AM, Keren Rosado - NOAA Affiliate <
keren.rosado at noaa.gov> wrote:

> Hello,
>
> I am trying to open a .txt file in a .gs grads script without luck.
> Grads version 2.0.1
>
>
> This is what I have
>
> 'open dummy.ctl'
> file = 'A20100826a.txt'
> colors="1 2 3 4 5 6 7 8 9 10 11 12 13"
> ccount=0
>
> rc=1
> while (rc != 2)
>    data=read(file)
>    rc=sublin(data,1)
>    if (rc != 2)
>       line=sublin(data,2)
>       chk=substr(line,1,10)
>       if (chk != "----------")
> .
> .
> .
> .
>  The code keeps going but the error is at the "file" line.
>
> Here is the error
> file = 'A20100826a.txt'
> Syntax Error:  Expected operand or '('
>   Error ocurred at column 1
> DEFINE error:  Invalid expression.
>
> Thanks!
>
>
>
> ----
> Keren Rosado
> PhD Candidate/Howard University/NOAA EPP GRTSP Fellow
> Intern/NOAA/NWS/NCEP/EMC
> 5830 University Research CT
> Cubicle 2795
> College Park, MD 20740
> Tel: (301)-683-3816 <%28301%29-683-3763>
> Cel: *(407)-621-1676 *
> Email: Keren.Rosado at noaa.gov <Bin.Liu at noaa.gov>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20151130/47a87913/attachment.html 


More information about the gradsusr mailing list