Skip to content

Instantly share code, notes, and snippets.

@tjmichael81
Created October 5, 2015 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjmichael81/e4af9884e705c45ffc15 to your computer and use it in GitHub Desktop.
Save tjmichael81/e4af9884e705c45ffc15 to your computer and use it in GitHub Desktop.
Create a text file with paths to all GIS data in a given workspace
import arcpy
import os
workspace = r"<Path to workspace>"
outFile = r"C:\TEMP\dataPaths.txt"
dataPaths = open(outFile, "a")
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace,
datatype="Any",
type="ALL"):
for filename in filenames:
dataPaths.write(os.path.join(dirpath, filename) + "\n")
dataPaths.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment