<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic listrasters wildcard multiple characters in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663993#M51582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to list a group of rasters in a file geodatabase. The rasters are named ending with numbers from 1-12 (eg. precip_1, precip_2, ...). I want to have a list of those rasters that end with the numbers 4-9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I achieve this? I thought of using the wildcard in the listrasters statement but I can't figure out how to search for multiple characters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here's the statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rasters = gp.ListRasters(?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice is very much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LionelMessi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Aug 2011 09:46:26 GMT</pubDate>
    <dc:creator>AlexanderHohl</dc:creator>
    <dc:date>2011-08-23T09:46:26Z</dc:date>
    <item>
      <title>listrasters wildcard multiple characters</title>
      <link>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663993#M51582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to list a group of rasters in a file geodatabase. The rasters are named ending with numbers from 1-12 (eg. precip_1, precip_2, ...). I want to have a list of those rasters that end with the numbers 4-9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I achieve this? I thought of using the wildcard in the listrasters statement but I can't figure out how to search for multiple characters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here's the statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rasters = gp.ListRasters(?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice is very much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LionelMessi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2011 09:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663993#M51582</guid>
      <dc:creator>AlexanderHohl</dc:creator>
      <dc:date>2011-08-23T09:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: listrasters wildcard multiple characters</title>
      <link>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663994#M51583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could do this using a 'while' loop.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;x = 4

while x &amp;lt; 10:
&amp;nbsp;&amp;nbsp;&amp;nbsp; lstRasters = gp.ListRasters("*" + str(x))
&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in lstRasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print raster
&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:04:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663994#M51583</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T04:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: listrasters wildcard multiple characters</title>
      <link>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663995#M51584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could do this using a 'while' loop.&amp;nbsp; Ex:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;x = 4

while x &amp;lt; 10:
&amp;nbsp;&amp;nbsp;&amp;nbsp; lstRasters = gp.ListRasters("*" + str(x))
&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in lstRasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print raster
&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This works excellent. Thanks a lot JSkinn.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listrasters-wildcard-multiple-characters/m-p/663995#M51584</guid>
      <dc:creator>AlexanderHohl</dc:creator>
      <dc:date>2021-12-12T04:04:11Z</dc:date>
    </item>
  </channel>
</rss>

