<div dir="ltr">Kevin:<div><br></div><div>Thank you for this very clear explanation for how to read multiple files with systemfunc "ls."</div><div><br></div><div>Barry</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 13, 2017 at 1:16 AM, Kevin Hallock <span dir="ltr"><<a href="mailto:hallock@ucar.edu" target="_blank">hallock@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Sujit,<div><br></div><div>The simplest way to open multiple wrfout files would be something like this:</div><div><font face="Menlo">files = systemfunc("ls wrfout_d01_2016-12*")</font></div><div><font face="Menlo">f = addfiles(files, "r")</font></div><div><br></div><div>This will load all files that begin with “<span style="font-family:Menlo">wrfout_d01_2016-12</span>” (in other words any file from December 2016).</div><div><br></div><div>If you want to include files from 2017 as well, you could run:</div><div><div><font face="Menlo">files = systemfunc("ls wrfout_d01_2016-12* </font><span style="font-family:Menlo">wrfout_<wbr>d01_2017*</span><span style="font-family:Menlo">")</span></div><div><font face="Menlo">f = addfiles(files, "r")</font></div></div><div><br></div><div>This will load all files that begin with “<span style="font-family:Menlo">wrfout_d01_2016-12</span>” or “<span style="font-family:Menlo">wrfout_d01_2017</span>” (in other words any file from December 2016 or all of 2017). </div><div><br></div><div>Alternatively, if you need more control over which files are selected, you could try something like this instead:</div><div><div><font face="Menlo">files = systemfunc("ls wrfout_d01_2016-12-0[123]*")</font></div><div><font face="Menlo">f = addfiles(files, "r")</font></div><div><br></div></div><div>This loads all files that begin with “<span style="font-family:Menlo">wrfout_d01_2016-12-0</span>” and where the following character is 1, 2, or 3 (so just December 1 through 3).</div><div><br></div><div>Finally, you can also include time with the date in your “ls” command. For example, if you wanted all files from December 1 through 9 at 12:00:</div><div><div><font face="Menlo">files = systemfunc("ls wrfout_d01_2016-12-0[0-9]_12:<wbr>00:00")</font></div><div><font face="Menlo">f = addfiles(files, "r")</font></div></div><div><br></div><div>I hope this helps,</div><div><br></div><div>Kevin </div><div><div class="h5"><div><br><div><blockquote type="cite"><div>On Oct 12, 2017, at 12:05 AM, Sujit Maji <<a href="mailto:sujit.cat@tropmet.res.in" target="_blank">sujit.cat@tropmet.res.in</a>> wrote:</div><br class="m_4460316095149711306Apple-interchange-newline"><div><div>Hi all,<br><br>Have anyone tried to select wrfout*(WRF model output) files (as input to addfiles function in ncl) based on the date stamp on filename ?<br><br>e.g. suppose filename is wrfout_d01_2016-12-01_00:00:<wbr>00 <br><br>and <br><br>I want to select files with dates later than 2016_12_01 (1st December 2016) in filename i.e. wrfout_d01_2016-12-02_00:00:00 or wrfout_d01_2016-12-03_00:00:<wbr>00. <br><br><br>I don't have expertise in sed,awk or find utilities of GNU. That's why I asked.<br><br>If anyone have tried please share any experience.<br><br>Thanks and regards,<br>Sujit Maji<br>IITM Pune<br>______________________________<wbr>_________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br></div></div></blockquote></div><br></div></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>