[gradsusr] Getting date and run from filename

Jennifer Adams jma at cola.iges.org
Wed Sep 25 15:32:20 EDT 2013


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 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130925/22a81f05/attachment-0001.html 


More information about the gradsusr mailing list