<?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 Re: use more than one search term in ListTables in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/use-more-than-one-search-term-in-listtables/m-p/1084656#M61907</link>
    <description>&lt;P&gt;No.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listtables.htm" target="_self"&gt;ListTables—ArcGIS Pro&lt;/A&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listtables.htm" target="_blank"&gt; | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;concatenating the lists is fine even if one of the lists is empty&lt;/P&gt;&lt;LI-CODE lang="python"&gt;q = ['a', 'b']
q0 = []
q + q0
['a', 'b']&lt;/LI-CODE&gt;&lt;P&gt;you can use a list comprehension to make it look a tad better&lt;/P&gt;&lt;LI-CODE lang="python"&gt;table_lst = [arcpy.ListTables(i) for i in ["PES.IPM.Ad*", "PES.IPM.T*"]]&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 30 Jul 2021 22:56:22 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-07-30T22:56:22Z</dc:date>
    <item>
      <title>use more than one search term in ListTables</title>
      <link>https://community.esri.com/t5/python-questions/use-more-than-one-search-term-in-listtables/m-p/1084627#M61906</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;Is there a way to pass multiple search terms (or wildcards as described in the documentation) to the arcpy function ListTables?&amp;nbsp; I've tried passing in a comma separate list of strings and passing in an array of strings. Neither of those approaches worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to work with all the tables that start with 'Ad' and those that start with 'T'. What i am doing now is calling the ListTables function twice (see below). This gets the results I need, but it seems very heavy - i have to go to the workspace twice to get the list i'm after:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;datalist&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ListTables&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"PES.IPM.Ad*"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ListTables&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"PES.IPM.T*"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'd rather make the call once, passing something like this instead:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;datalist&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ListTables&lt;/SPAN&gt;&lt;SPAN&gt;([&lt;/SPAN&gt;&lt;SPAN&gt;"PES.IPM.Ad*",&amp;nbsp;"PES.IPM.T**" ]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is such a thing possible?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Jul 2021 21:21:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-more-than-one-search-term-in-listtables/m-p/1084627#M61906</guid>
      <dc:creator>Trippetoe</dc:creator>
      <dc:date>2021-07-30T21:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: use more than one search term in ListTables</title>
      <link>https://community.esri.com/t5/python-questions/use-more-than-one-search-term-in-listtables/m-p/1084656#M61907</link>
      <description>&lt;P&gt;No.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listtables.htm" target="_self"&gt;ListTables—ArcGIS Pro&lt;/A&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listtables.htm" target="_blank"&gt; | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;concatenating the lists is fine even if one of the lists is empty&lt;/P&gt;&lt;LI-CODE lang="python"&gt;q = ['a', 'b']
q0 = []
q + q0
['a', 'b']&lt;/LI-CODE&gt;&lt;P&gt;you can use a list comprehension to make it look a tad better&lt;/P&gt;&lt;LI-CODE lang="python"&gt;table_lst = [arcpy.ListTables(i) for i in ["PES.IPM.Ad*", "PES.IPM.T*"]]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 30 Jul 2021 22:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-more-than-one-search-term-in-listtables/m-p/1084656#M61907</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-07-30T22:56:22Z</dc:date>
    </item>
  </channel>
</rss>

