AnsweredAssumed Answered

Merge Script

Question asked by clclark on Feb 13, 2013
Latest reply on Apr 10, 2014 by iamurray
Does this python script look correct for a merge?

# Import arcpy module import arcpy, sys, traceback arcpy.env.overwriteOutput = True from os import path as p   # Set Workspace arcpy.env.workspace = r"G:\ChrisGIS\PS_Steelhead\Archive"  # Set Variables. "out" will be our output variable. Inside the "Try" loop we search all workspaces # for the Feature Class we are interested in. This list of feature classes is set to listFCS  out = r"G:\ChrisGIS\PS_Steelhead\Scratch"  for ws in arcpy.Listworkspaces("*", "FileGDB"):  arcpy.env.workspace = ws  print '\n\Searching in %s\n\n' %ws  listFCS = arcpy.ListFeatureClasses("*_NWIFC_STHD")  # Now Merge all Feature Classes and export to the Output  arcpy.Merge_management(listFCS, os.path.join(out, "Merged_HUC8_STHD") print "Done"