Last active
April 23, 2019 18:04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, arcpy | |
#create blank text file | |
with open("C:\\Temp\\GISlayers.txt", "w") as txt: | |
for root, dirs, files in os.walk("C:\\Temp\\temp"): | |
for f in files: | |
#look for shapefiles | |
if f.endswith('.shp') or f.endswith('.lyr') or | |
f.endswith('.img'): | |
desc = arcpy.Describe(root + "\\" + f) | |
#write info to text file | |
txt.write(desc.name + "," + desc.catalogPath + "\n") | |
#look for file geodatabases | |
if f.endswith('.gdb'): | |
desc = arcpy.Describe(root) | |
for child in desc.children: | |
#write info to text file | |
txt.write(child.name + "," + child.path + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment