Hi, so here's what I'm trying to do. I have a parent folder, which I'm calling my workspace. Under that folder are several subfolders, each containing one file geodatabase. Each file geodatabase contains unique feature datasets that I'm trying to merge into one final file geodatabase.
I'm stuck at building the list of the feature datasets. Here's the code in question:
folder <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\\Temp\\Extracted"</SPAN>
walk <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>Walk<SPAN class="punctuation token">(</SPAN>folder<SPAN class="punctuation token">,</SPAN> datatype<SPAN class="operator token">=</SPAN><SPAN class="string token">"FeatureDataset"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> dirpath<SPAN class="punctuation token">,</SPAN> workspaces<SPAN class="punctuation token">,</SPAN> datatypes <SPAN class="keyword token">in</SPAN> walk<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> datatype <SPAN class="keyword token">in</SPAN> datatypes<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>datatype<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This code yields *everything* in the subdirectory structure down to the feature dataset level. It lists all folder names, all file geodatabases at the .gdb level, and all feature datasets.
What I'm trying to do is get a list back of *only* feature datasets. Can someone tell me where I'm going wrong?