Skip to main content
Updated for 10.1
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

If you have ArcGIS versionDesktop 10 or greater.0 (or any of its service packs), I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
        #look for file geodatabases
        foundGDB = f.find(".gdb")
        if foundGDB >0:
            desc = arcpy.Describe(root)
            for child in desc.children:
            #write info to text file
            txt.write(child.name + "," + child.path + "\n")
        break
txt.close()

Hope this helpsIf you are using ArcGIS 10.1 (or later) for Desktop then there is another Answer here that uses arcpy.da.Walk which was not available at 10.0 or earlier.

If you have ArcGIS version 10 or greater, I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
        #look for file geodatabases
        foundGDB = f.find(".gdb")
        if foundGDB >0:
            desc = arcpy.Describe(root)
            for child in desc.children:
            #write info to text file
            txt.write(child.name + "," + child.path + "\n")
        break
txt.close()

Hope this helps.

If you have ArcGIS Desktop 10.0 (or any of its service packs), I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
        #look for file geodatabases
        foundGDB = f.find(".gdb")
        if foundGDB >0:
            desc = arcpy.Describe(root)
            for child in desc.children:
            #write info to text file
            txt.write(child.name + "," + child.path + "\n")
        break
txt.close()

If you are using ArcGIS 10.1 (or later) for Desktop then there is another Answer here that uses arcpy.da.Walk which was not available at 10.0 or earlier.

deleted 19 characters in body
Source Link
artwork21
  • 35.2k
  • 8
  • 67
  • 134

If you have ArcGIS version 10 or greater, I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
                #look for file geodatabases
                foundGDB = f.find(".gdb")
                if foundGDB >0:
                    desc = arcpy.Describe(root)
                    for child in desc.children:
                        #write info to text file
                        txt.write(child.name + "," + child.path + "\n")
                    break
txt.close()

Hope this helps.

If you have ArcGIS version 10 or greater, I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
                #look for file geodatabases
                foundGDB = f.find(".gdb")
                if foundGDB >0:
                    desc = arcpy.Describe(root)
                    for child in desc.children:
                        #write info to text file
                        txt.write(child.name + "," + child.path + "\n")
                    break
txt.close()

Hope this helps.

If you have ArcGIS version 10 or greater, I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
        #look for file geodatabases
        foundGDB = f.find(".gdb")
        if foundGDB >0:
            desc = arcpy.Describe(root)
            for child in desc.children:
            #write info to text file
            txt.write(child.name + "," + child.path + "\n")
        break
txt.close()

Hope this helps.

Source Link
artwork21
  • 35.2k
  • 8
  • 67
  • 134

If you have ArcGIS version 10 or greater, I think your best bet is writing a python script that uses os.walk to look through a defined GIS directory and searches for common GIS file extensions such as .shp, .gdb, .mdb, etc... and writes the result to a comma delimited text file. You can then bring the text file into excel, see code example below:

import os, arcpy

#create blank text file
txt = open("C:\\Temp\\GISlayers.txt", "w")

for root, dirs, files in os.walk("C:\\Temp\\temp"):
    for f in files:
    
        #look for shapefiles
        foundSHP = f.find(".shp")
        if foundSHP >0:
            checkEXT = f[-3:]
                if checkEXT <> "xml":
                    desc = arcpy.Describe(root + "\\" + f)
                    #write info to text file
                    txt.write(desc.name + "," + desc.catalogPath + "\n")
                    
                #look for file geodatabases
                foundGDB = f.find(".gdb")
                if foundGDB >0:
                    desc = arcpy.Describe(root)
                    for child in desc.children:
                        #write info to text file
                        txt.write(child.name + "," + child.path + "\n")
                    break
txt.close()

Hope this helps.