<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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. <div>--Jennifer</div><div><br><div><br><div><div>On Sep 25, 2013, at 3:06 PM, Brian Gaze wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi,<div><br></div><div>Using GrADS script is there a way (perhaps using substr) of returning part of the open filename to a variable? </div><div><br></div><div>For example, I have opened the .ctl file which relates to this file:</div>
<div><br><div>pgbf.01.2013092406.201309.avrg.grib.06Z.grb2<br></div></div><div><br></div><div>I would like to extract the '201309' and '06Z' parts of the string to variables. </div><div><br></div><div>I'm familiar with using something like:</div>
<div><br></div><div>q time</div><div>res=subwrd(result,3)<br></div><div>....etc</div><div><br></div><div>but can't see how to do something similar querying the filename of the grb2 file rather than time.</div><div><br>
</div><div>Thanks</div><div><br></div><div>Brian </div></div>
_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>