<?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: Using da.Walk to discover feature datasets throughout a series of subfolders in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311396#M24248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes. &amp;nbsp;I don't know why they didn't do it for 10.4... but having said that, you just need to install PRO and you can work in both worlds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/04/12/coming-to-python-preparation-and-anticipation"&gt;/blogs/dan_patterson/2016/04/12/coming-to-python-preparation-and-anticipation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/07/17/anaconda-spyder-and-arcgis-pro"&gt;/blogs/dan_patterson/2016/07/17/anaconda-spyder-and-arcgis-pro&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you have an iPhone, iPad or any iThingy.....&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/06/17/python-35-comes-to-ithings"&gt;/blogs/dan_patterson/2016/06/17/python-35-comes-to-ithings&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2016 20:50:59 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-09-29T20:50:59Z</dc:date>
    <item>
      <title>Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311388#M24240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, so here's what I'm trying to do. &amp;nbsp;I have a parent folder, which I'm calling my workspace. &amp;nbsp;Under that folder are several subfolders, each containing one file geodatabase. &amp;nbsp;Each file geodatabase contains unique feature datasets that I'm trying to merge into one final file geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm stuck at building the list of the feature datasets. &amp;nbsp;Here's the code in question:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;folder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:\\Temp\\Extracted"&lt;/SPAN&gt;

walk &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Walk&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;folder&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; datatype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FeatureDataset"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; dirpath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; workspaces&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; datatypes &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; walk&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; datatype &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; datatypes&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datatype&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code yields *everything* in the subdirectory structure down to the feature dataset level. &amp;nbsp;It lists all folder names, all file geodatabases at the .gdb level, and all feature datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is get a list back of *only* feature datasets. &amp;nbsp;Can someone tell me where I'm going wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:53:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311388#M24240</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2021-12-11T14:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311389#M24241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have a Python3 print statement.&amp;nbsp; Are you using ArcPy that comes with ArcGIS Pro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run your code in ArcCatalog, as is but with a different starting directory, it prints nothing.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 15:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311389#M24241</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-09-29T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311390#M24242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the steps on adding code blocks to GeoNet:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/huffmanp/blog/2014/07/08/how-do-we-add-code-blocks-in-this-new-forum"&gt;https://community.esri.com/people/huffmanp/blog/2014/07/08/how-do-we-add-code-blocks-in-this-new-forum&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add to &lt;A href="https://community.esri.com/people/bixb0012"&gt;bixb0012&lt;/A&gt;‌ comments, can you post the output of your script, perhaps in a txt file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 15:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311390#M24242</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2016-09-29T15:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311391#M24243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeah, so I'm actually using this in Spyder outside of ArcMap, just calling arcpy as another library so the python3 print statements work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've updated the code a bit further to this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;folder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:\\Temp\\Extracted"&lt;/SPAN&gt;
gdbList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; paths&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; subdirs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; names &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;walk&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;folder&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; subdir &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; subdirs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; subdirs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;endswith&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;".gdb"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fullName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;paths&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gdbList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fullName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Appended {} to gdbList"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fullName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fdList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fgdb &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; gdbList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; walk &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Walk&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fgdb&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; datatype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FeatureDataset"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fd &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; walk&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fdList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fdList&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem now is that the feature dataset list (fdList) contains the full path including the geodatabase in the following format returned in a list of tuples. &amp;nbsp;The way they are formatted is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[(u'C:\\Temp\\Extracted\\dir1\\geodatabase01.gdb', [u'Water_Network'], []), (u'C:\\Temp\\Extracted\\dir1\\geodatabase01.gdb\\Water_Network', [], []), (u'C:\\Temp\\Extracted\\dir2\\geodatabase02.gdb', [u'Electric_Network'], []), (u'C:\\Temp\\Extracted\\dir2\\geodatabase02.gdb\\Electric_Network', [], []), (and so on.....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again what I'm trying to do is to isolate the feature dataset here and use arcpy copy management to copy it all into a consolidated file geodatabase. &amp;nbsp;I feel like I'm close but missing some glue here, because I can't iterate the copy_management through the fdList object yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(edited for a more thorough example of the output)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:53:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311391#M24243</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2021-12-11T14:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311392#M24244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christian as well&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;beyond the basic stuff as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 17:58:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311392#M24244</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-29T17:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311393#M24245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you only want to copy feature datasets, and not feature classes in the GDBs, what about the following (&lt;EM&gt;haven't fully tested&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;folder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# path to starting directory&lt;/SPAN&gt;
dst_gdb &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# path to destination gdb&lt;/SPAN&gt;
walk &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Walk&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;folder&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dirs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; files &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; walk&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;endswith&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'.gdb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; dir &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; dirs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Copy_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;root&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dir&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dst_gdb&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dir&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:53:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311393#M24245</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T14:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311394#M24246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI to all... the print statement works fine in 2.7 as well as in the 3.x series and has for the last 7 (?) years. &amp;nbsp;Get used to it, you will need to use 3.x-ish for work in Pro and arcmap in upcoming versions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 20:30:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311394#M24246</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-29T20:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311395#M24247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You think they will migrate ArcMap to Python 3.x?&amp;nbsp; You are a more hopeful man than I. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 20:41:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311395#M24247</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-09-29T20:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311396#M24248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes. &amp;nbsp;I don't know why they didn't do it for 10.4... but having said that, you just need to install PRO and you can work in both worlds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/04/12/coming-to-python-preparation-and-anticipation"&gt;/blogs/dan_patterson/2016/04/12/coming-to-python-preparation-and-anticipation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/07/17/anaconda-spyder-and-arcgis-pro"&gt;/blogs/dan_patterson/2016/07/17/anaconda-spyder-and-arcgis-pro&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you have an iPhone, iPad or any iThingy.....&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/06/17/python-35-comes-to-ithings"&gt;/blogs/dan_patterson/2016/06/17/python-35-comes-to-ithings&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 20:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311396#M24248</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-29T20:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311397#M24249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem with this is that each file geodatabase is in its own subdirectory. &amp;nbsp;So when I use da.Walk and list dirs, it lists OS subdirectories and geodatabases in the results alongside the feature datasets. &amp;nbsp;Please see my updated code and the updated output I've listed. &amp;nbsp;At this point I'm just trying to figure out how to do copy management given the tuples I'm being returned.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 13:41:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311397#M24249</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2016-09-30T13:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311398#M24250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since geodatabases can't be nested within each other, and we aren't talking about geodatabase replication, I don't fully understand your reference to "parent geodatabases."&amp;nbsp; Regardless, if you have something that works for you, and only want to work with the tuples being returned, use &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;os.path.join&lt;/SPAN&gt;:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fd &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fdList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Copy_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fd&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fd&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;destination_gdb&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fd&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:53:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311398#M24250</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T14:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311399#M24251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Joshua, I mis-typed there - I edited my response to make it more accurate. &amp;nbsp;My issue is that even though I have da.Walk limited to a datatype="FeatureDataset", it doesn't list only feature datasets. &amp;nbsp;It lists folders, geodatabases, AND feature datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 16:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311399#M24251</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2016-09-30T16:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311400#M24252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to avoid using the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;datatype&lt;/SPAN&gt; parameter of &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;arcpy.da.Walk&lt;/SPAN&gt; if possible because the definitions of those data types are poorly documented.&amp;nbsp; As you describe, &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"FeatureDataset"&lt;/SPAN&gt; returns not only feature datasets but also subfolders within a folder.&amp;nbsp; With ArcGIS 10.4.x, they finally removed the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"Geo"&lt;/SPAN&gt; option after I kept asking for a clear definition since the results were strange, to say the least, when using it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My fuller code snippet should work for you because I am testing whether Walk is already in a file geodatabase before looking at the folders returned, which will be&amp;nbsp;datasets of one kind or another.&amp;nbsp; If you have multiple kinds of datasets (FeatureDataset, RasterDataset, etc...) and only want a particular kind, the script can be modified to use &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;arcpy.Describe&lt;/SPAN&gt; to narrow down the results even further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 20:38:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311400#M24252</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-10-03T20:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using da.Walk to discover feature datasets throughout a series of subfolders</title>
      <link>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311401#M24253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua, sorry for the lateness of this reply but I figured I'd chime in and close the loop for anyone who may stumble on this question later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way I fixed this was to basically check for file geodatabases first, feature datasets second, and feature classes last, extracting each to their own list. &amp;nbsp;It is certainly inelegant but it gives me reliable results. &amp;nbsp;So it looks a bit like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gdbList = []&lt;/P&gt;&lt;P&gt;fdList = []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for paths, subdirs, names in os.walk(workingPath):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; for subdir in subdirs:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if subdir[-4:] == '.gdb':&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdbName = os.path.join(paths, subdir)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gdbList.append(gdbName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for fgdb in gdbList:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; walk = arcpy.da.Walk(fgdb, datatype="FeatureDataset")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for fd in walk:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if fd[0][-4:] not in '.gdb':&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fdList.append(fd[0])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I'm building lists through brute-force string checking.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 14:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-da-walk-to-discover-feature-datasets/m-p/311401#M24253</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2016-10-17T14:48:08Z</dc:date>
    </item>
  </channel>
</rss>

