<?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: How do I loop a folder of mxds in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491444#M38502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is part of my &lt;A href="https://community.esri.com/migration-blogpost/55043" target="_blank"&gt;Python addin for data inventory and “broken-link” repair.&lt;/A&gt;​ tool box, but I'll include the first script here.&amp;nbsp; It inventories and lists the fgdb to out put csv, and it also coverts it to an .xsl&amp;nbsp; (not .xlsx).&amp;nbsp; Maybe you can pick out what you need from this.&lt;/P&gt;&lt;P&gt;EDIT: bTW replace all the myMsgs with print or arcpy add message .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;'''
---------------------------------------------------------------------------
Tool:&amp;nbsp;&amp;nbsp;&amp;nbsp; FCInventoryReport 
Toolbox: CheckAndFixLinks.tbx
Script:&amp;nbsp; 2_InventoryFCs.py
Purpose: 
&amp;nbsp;&amp;nbsp; This script will walk thru all the feature classes within a folder 
&amp;nbsp;&amp;nbsp; and create a text report, comma-delimted and an Excel .xls file.
&amp;nbsp;&amp;nbsp; Include shapes, coverages, rasters, tables, connections, and FGDB

&amp;nbsp;&amp;nbsp; Column names:&amp;nbsp; FType&amp;nbsp;&amp;nbsp;&amp;nbsp; FCname&amp;nbsp;&amp;nbsp;&amp;nbsp; FullPath
-------------------------------------------------------------------------------
 Author:&amp;nbsp; Rebecca Strauch - ADFG-DWC-GIS
 Created on: 4/10/2013 
&amp;nbsp;&amp;nbsp; last modification: August 10, 2015

 Description: To create list of the features classes within a folder, including
&amp;nbsp;&amp;nbsp; coverages (pts, poly, arc, anno), shapes, grids and FGDB data. Outputs list
&amp;nbsp;&amp;nbsp; to a text report file (not much formatting) in the folder being scanned named
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FCInventoryYYYYMMDD_HHMM.txt
&amp;nbsp;&amp;nbsp; with the date and time as part of the name. This should always create
&amp;nbsp;&amp;nbsp; a new file, unless you run it twice within same minute.&amp;nbsp; 

&amp;nbsp;&amp;nbsp; Must have write permissions on the output folder in question.

&amp;nbsp;&amp;nbsp; Known issue (with built-in workaround): for some reason some, but not&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all (ArcInfo) grids want to duplicate the folder name before the 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; describe. I'm now checking to make sure it exists, if not, I am removing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the duplicate portion, and letting it run.&amp;nbsp; Seems to work.
------------------------------------------------------------------------------
 Arguments:&amp;nbsp; 
&amp;nbsp;&amp;nbsp; [0] theWorkspace: Folder/directory to search (walk thru, includes subfolders)
&amp;nbsp;&amp;nbsp; [1] outFile: output base filename, default GDBList, script appends YYYYMMDD_HHMM

 Updates:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
---------------------------------------------------------------------------
'''
# Import modules
import arcpy
import os
from _miscUtils import *
from _gpdecorators import *

# catch_errors decorator must preceed a function using the @ notation.
@catch_errors
def main():
&amp;nbsp; """
&amp;nbsp; Main function to create text file report of all Feature Classes in folder
&amp;nbsp; """
&amp;nbsp; #setup environment
&amp;nbsp; arcpy.env.overwriteOutput = True

&amp;nbsp; # Script arguments...&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; """ If running as standalone, hardcode theWorkspace and outFile&amp;nbsp; """
&amp;nbsp; theWorkspace = arcpy.GetParameterAsText(0)
&amp;nbsp; if not theWorkspace:
&amp;nbsp;&amp;nbsp;&amp;nbsp; theWorkspace = r"C:\__Data1\_TalkeetnaBU" # r"D:\_dataTest"&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp; outFile = arcpy.GetParameterAsText(1)
&amp;nbsp; if not outFile:
&amp;nbsp;&amp;nbsp;&amp;nbsp; outFile = "FCInventory" 
&amp;nbsp; # Create new output name name tagged with YYYYMMDD_HHMM
&amp;nbsp; fileDateTime = curFileDateTime()
&amp;nbsp; currentDate = curDate()

&amp;nbsp; # Create new output name tagged with YYYYMMDD_HHMM
&amp;nbsp; outfileTXT = os.path.join(theWorkspace, outFile) + fileDateTime + ".txt" #theWorkspace + "\FCInventory" + fileDateTime + ".txt"
&amp;nbsp; outFileCSV = os.path.join(theWorkspace, outFile) + fileDateTime + ".csv"&amp;nbsp; #theWorkspace + "\FCInventory" + fileDateTime + ".csv"
&amp;nbsp; outFileXLS = os.path.join(theWorkspace, outFile) + fileDateTime + ".xls"
&amp;nbsp; arcpy.AddMessage(theWorkspace + ", " + outfileTXT)
&amp;nbsp; reportFile = open(outfileTXT, 'w')
&amp;nbsp; csvFile = open(outFileCSV, 'w')
&amp;nbsp; arcpy.AddMessage(&amp;nbsp; "File {0} is open? {1}".format(outfileTXT, str(not reportFile.closed)))
&amp;nbsp; arcpy.AddMessage(&amp;nbsp; "File {0} is open? {1}".format(str(outFileCSV), str(not csvFile.closed)))
&amp;nbsp; #arcpy.AddMessage(&amp;nbsp; "File " + str(csvFile) + " is closed?&amp;nbsp; " + str(csvFile.closed))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; arcpy.AddMessage("Writing the report to: " + outfileTXT + " and " + outFileCSV)

&amp;nbsp; outText = "List of all GIS data in " + theWorkspace + " on " + currentDate + '\n'
&amp;nbsp; outText += "&amp;nbsp; Includes coverages (pts, poly, arc, anno), shapes, and FGDB data." + '\n'
&amp;nbsp; outText += "-----------------------------------------------------" + '\n'

&amp;nbsp; reportFile.write(outText)
&amp;nbsp; csvFile.write("FType, FCname, FullPath\n")

&amp;nbsp; def inventory_data(workspace, datatypes):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for path, path_names, data_names in arcpy.da.Walk(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspace, datatype=datatypes):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if "tic" in data_names:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_names.remove('tic')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for data_name in data_names:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcName = os.path.join(path, data_name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.AddMessage("Show for debug: " + fcName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not arcpy.Exists(fcName):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # workaround for raster folder name duplicating
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcName = os.path.dirname(fcName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(fcName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.AddMessage("debug, desc it to me: " + desc.dataType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yield [path, data_name, desc.dataType] #, desc]

&amp;nbsp; i = 0
&amp;nbsp; for feature_class in inventory_data(theWorkspace, "FeatureClass"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """ last modified data not working for gdb or FC in fgdb ..."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; #lastMod = time.strftime('%m/%d/%Y %H:%M', time.localtime(os.path.getmtime(feature_class[0])))
&amp;nbsp;&amp;nbsp;&amp;nbsp; if i == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.AddMessage("{0}&amp;nbsp; modified: {1}".format(feature_class[0], lastMod)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("{0}".format(feature_class[0]))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outText = ' ' + feature_class[0] + '\n'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reportFile.write(outText)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path0 = feature_class[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i =+ 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif not path0 == feature_class[0]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.AddMessage("{0}&amp;nbsp; modified: {1}".format(feature_class[0], lastMod)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("{0}".format(feature_class[0]))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outText = ' ' + feature_class[0] + '\n'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reportFile.write(outText)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; if feature_class[2] == "ShapeFile":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shpfile = arcpy.os.path.join(feature_class[0], feature_class[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastMod = time.strftime('%m/%d/%Y %H:%M', time.localtime(os.path.getmtime(shpfile)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0}: {1} modified: {2}".format(feature_class[2], feature_class[1], lastMod))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outText = ("&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0}: {1} modified: {2}\n".format(feature_class[2], feature_class[1], lastMod))
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0}: {1}".format(feature_class[2], feature_class[1]))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outText = ("&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0}: {1}\n".format(feature_class[2], feature_class[1]))
&amp;nbsp;&amp;nbsp;&amp;nbsp; reportFile.write(outText)
&amp;nbsp;&amp;nbsp;&amp;nbsp; csvFile.write("{},{}, {}\n".format(feature_class[2], feature_class[1], feature_class[0]))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp; reportFile.close()
&amp;nbsp; csvFile.close()
&amp;nbsp; arcpy.AddMessage(&amp;nbsp; "File {0} is closed? {1}".format(outfileTXT, str(reportFile.closed)))
&amp;nbsp; arcpy.AddMessage(&amp;nbsp; "File {0} is closed? {1}".format(outFileCSV, str(csvFile.closed)))

&amp;nbsp; # Creates Excel .xls file from the .csv ....easier to edit (ver 1)
&amp;nbsp; arcpy.TableToExcel_conversion(outFileCSV, outFileXLS) 

&amp;nbsp; arcpy.AddMessage('!!! Success !!!&amp;nbsp; ')

# End main function

if __name__ == '__main__':
&amp;nbsp; main()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:37:46 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2021-12-11T21:37:46Z</dc:date>
    <item>
      <title>How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491404#M38462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to loop many mxds within a folder to retrieve layer,connection,etc. information using python.&lt;/P&gt;&lt;P&gt;I just need the syntax for looping through the mxds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 15:23:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491404#M38462</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T15:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491405#M38463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search through geonet threads for Walk function in python.&amp;nbsp; You can also search outside geonet for python and walk.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 15:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491405#M38463</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2016-05-10T15:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491406#M38464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are interested in the innards of the mxd, many recommend ... &lt;A href="https://www.arcgis.com/home/item.html?id=f0ae73e90c1a4992a1059e7d370966d4" title="https://www.arcgis.com/home/item.html?id=f0ae73e90c1a4992a1059e7d370966d4"&gt;https://www.arcgis.com/home/item.html?id=f0ae73e90c1a4992a1059e7d370966d4&lt;/A&gt; X-ray&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 16:07:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491406#M38464</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-10T16:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491407#M38465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the advice. I have been using X-ray, but it doesn't quite fit my purpose. I need the mxd info written to a excel sheet to be used as a ArcGIS table.&lt;/P&gt;&lt;P&gt;Also, the most import need is to loop which X-ray is used on the currently opened mxd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 16:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491407#M38465</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T16:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491408#M38466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like I need the arcpy.da.Walk and not the os.walk which doesn't return database related features.&lt;/P&gt;&lt;P&gt;Still working on it though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 16:31:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491408#M38466</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491409#M38467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of database related features are you looking for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 16:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491409#M38467</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2016-05-10T16:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491410#M38468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FeatureClasess with info of their respective dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 16:44:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491410#M38468</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T16:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491411#M38469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following since I am not sure whether os.walk limitation apples to me since I want to get feature classes information within mxds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;/P&gt;&lt;P&gt;workspace = ' xxxxxx '&lt;/P&gt;&lt;P&gt;for root, dirs, files in os.walk(workspace):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in files:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if f.endswith(".mxd"):&lt;BR /&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; mxd = root + '\\' + f&lt;BR /&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; print f&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a list of mxds which is the first successful step but I need the feature classes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 17:27:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491411#M38469</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T17:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491412#M38470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to get the DataFrames in your mxd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mapping.ListDataFrames("name of mxd")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you'll need to get the layers in each data frame&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mapping.ListLayers("name of mxd, "", "name of data frame")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 17:44:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491412#M38470</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2016-05-10T17:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491413#M38471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I input the workspace for listdataframes &amp;amp; listlayers since I want info on 19 mxds, not just one&amp;nbsp; ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 17:49:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491413#M38471</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T17:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491414#M38472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Walk function in python that Michael had mentioned to loop throught the mxds.&amp;nbsp; For each mxd, you can use what he later suggested with looping through the dataframes and layers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;A loop within a loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 17:55:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491414#M38472</guid>
      <dc:creator>JenniferMcCall4</dc:creator>
      <dc:date>2016-05-10T17:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491415#M38473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2691"&gt;Rebecca Strauch, GISP&lt;/A&gt;​ produced this &lt;A href="https://community.esri.com/migration-blogpost/55043"&gt;Python addin for data inventory and “broken-link” repair.&lt;/A&gt; &lt;/P&gt;&lt;P&gt;which does project inventory, if it doesn't serve purposes, perhaps she might have some commentary on what you are trying to accomplish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 17:55:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491415#M38473</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-10T17:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491416#M38474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Devin, it definitly is worth trying my data inventory addin, as Dan mentioned.&amp;nbsp; since there are so many different types of data and data connections that can be within any mxd, there are many tests that need to be filtered thru to find the right pe.&amp;nbsp; The add in does that fairly well, but still may not catch ALL oes yet.&amp;nbsp; But it does spit out an excel and .csv output so you can see what you have.&amp;nbsp; It will do recursive mxds in a folder, and runs fairly fast so, the inventory part you should try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it doesn't get what you need, and .addin is just a zip file....change the extension and unzip.&amp;nbsp; You'll see how I looped thru everything, and you can grab snippets from thatand modify if needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 18:03:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491416#M38474</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-10T18:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491417#M38475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks great, I just browsed it quickly. Good advice use on a non-working testing folder/files. I will test this out. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 18:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491417#M38475</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T18:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491418#M38476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep in mind, if I remember correctly, the inventory lists all whether broken link or not.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The broken link list will list only those, and may differ depending on relative relationship, and user permissions, if you copy the data.....which I still recommend for testing.&amp;nbsp; I'm using it to find where users have local data for mxd's that are shared and in a network drive.&amp;nbsp; helps me find the local data that needs to be centrally located and fixed.&amp;nbsp; That might not be your need....but just a tidbit of possible usage.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 18:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491418#M38476</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-10T18:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491419#M38477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting, I used Select folder to walk thru &amp;amp; List all types of feature classes. It writes to excel with&amp;nbsp; just title headings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 18:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491419#M38477</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T18:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491420#M38478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying all three output files end up blank?&amp;nbsp; I just downloaded and ran it (second button...first only shows databases, not mxd data)&amp;nbsp; against a folder&amp;nbsp; that I created in the last few days (i.e., not the computer or folder I created and tested the addin on originally) I had two mxd it, and all three files were populated. For example, the .txt file showed...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="76" src="https://community.esri.com/legacyfs/online/199239_pastedImage_0.png" style="width: 211px; height: 76.2323px;" width="211" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe the excel file is a different version?&amp;nbsp; Maybe try double clicking the .csv and have it open in your versions of excel?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 18:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491420#M38478</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-10T18:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491421#M38479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, all outputs were blank. I opened the csv and it is blank also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 18:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491421#M38479</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T18:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491422#M38480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to change the .addin file to .zip, expand it and try running thru the toolbox instead as an addin with the buttons.&amp;nbsp; That way you can see a bit more of what it is trying to do.&amp;nbsp; Not sure why it is coming out blank, unless it is one of the types I dont have come red yet.&amp;nbsp; I think I have a lot of notes in the .py script itself on what does and doesn't&amp;nbsp; work.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 19:07:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491422#M38480</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-10T19:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I loop a folder of mxds</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491423#M38481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I went ahead and did as you suggested. I opened and parsed the syntax to attempt in getting only what I need. No luck in successfully creating a script for what I want. I apologize for taking up your time. You have been more than helpful. I don't know what I cant seem to get this right to loop all mxds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 20:19:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-loop-a-folder-of-mxds/m-p/491423#M38481</guid>
      <dc:creator>DevinUnderwood2</dc:creator>
      <dc:date>2016-05-10T20:19:11Z</dc:date>
    </item>
  </channel>
</rss>

