<div dir="ltr"><div><div><div><div><div><div>Hi Alan,<br><br></div>I'm thinking it may be easiest to let Python do the heavy lifting on this to figure out the files to read in. You can use glob from the glob module and then sort the files. So that would look like:<br>=======<br></div>import glob<br></div>files = glob.glob("z_pinch*")<br></div>files.sort() # if the order of the files isn't important you can probably skip this<br>========<br><br></div>You can use more advanced regex's in the glob() method to get pickier about the desired files, do a bit of playing around with sort() to get non-default sorting and then play with the list to get the files you want from them like the last 4 files.<br><br></div>Cheers,<br>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 6, 2015 at 10:12 PM, Scott, W Alan <span dir="ltr"><<a href="mailto:wascott@sandia.gov" target="_blank">wascott@sandia.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<font face="Calibri"><span style="font-size:11pt">
<div>I have a user that is trying to write a python script that reads in a dataset with a large number of files (say hundreds to thousands of files). The dataset is Exodus. This user wants to read in a large number of these datasets (dozens to hundreds),
with each dataset comprised of a different number of individual files than the other datasets. Thus, he doesn’t want to read in files like this (example, only 8 files):</div>
<div> </div>
<div>z_pinch1exo8 = ExodusIIReader(FileName=['z_pinch1.exo.8.0', 'z_pinch1.exo.8.1', z_pinch1.exo.8.2', 'z_pinch1.exo.8.3', 'z_pinch1.exo.8.4', 'z_pinch1.exo.8.5', 'z_pinch1.exo.8.6', 'z_pinch1.exo.8.7'])</div>
<div> </div>
<div> </div>
<div>But would rather like this:</div>
<div>z_pinch1exo8 = ExodusIIReader(FileName=['z_pinch1.exo.8.*’])</div>
<div>or</div>
<div>z_pinch1exo8 = ExodusIIReader(FileName=['z_pinch1.exo.”totalFileCount”.*’])</div>
<div> </div>
<div> </div>
<div>Is this possible in Python? What is the format?</div>
<div> </div>
<div>If the user wants to window into his data, say take the last 4 files, is this possible? </div>
<div> </div>
<div>Thanks,</div><span class="HOEnZb"><font color="#888888">
<div> </div>
<div>Alan</div>
<div> </div>
<div> </div>
<div> </div>
</font></span></span></font>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>