[gradsusr] Getting date and run from filename
Brian Gaze
brian.gaze at ntlworld.com
Wed Sep 25 16:36:54 EDT 2013
Thanks. Yes it was as easy as q file and substr . Sorry, it's been a long
day!
On 25 September 2013 20:32, Jennifer Adams <jma at cola.iges.org> wrote:
> Well, if your data set is not templated, the name of the data file will be
> in the output from 'q file' and 'q ctlinfo'. If you are templating, it's
> harder because the data file name contains the template strings, not the
> actual date strings. But maybe with the help of the 'q time' output you
> could piece it together.
> --Jennifer
>
>
> On Sep 25, 2013, at 3:06 PM, Brian Gaze wrote:
>
> Hi,
>
> Using GrADS script is there a way (perhaps using substr) of returning part
> of the open filename to a variable?
>
> For example, I have opened the .ctl file which relates to this file:
>
> pgbf.01.2013092406.201309.avrg.grib.06Z.grb2
>
> I would like to extract the '201309' and '06Z' parts of the string to
> variables.
>
> I'm familiar with using something like:
>
> q time
> res=subwrd(result,3)
> ....etc
>
> but can't see how to do something similar querying the filename of the
> grb2 file rather than time.
>
> Thanks
>
> Brian
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> --
> Jennifer M. Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> 111 Research Hall, Mail Stop 2B3
> George Mason University
> 4400 University Drive
> Fairfax, VA 22030
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130925/fdc47a2f/attachment.html
More information about the gradsusr
mailing list