So I have feature classes from an ArcGIS database that I renamed using this Python code: enter image description here

But now I have to merge all the feature classes that are output from this into one feature class named OSRS_ORN_NER. I'm not really sure how I should assign the inputs and outputs when I'm using the arcpy.Merge_management() tool. This is all I have right now: enter image description here

  • 1
    Please try to always include the text (not screenshots) of code and errors because that way they can be searched.
    – PolyGeo
    Commented Jan 19, 2015 at 22:25

1 Answer 1


Merge tool expect you a list of feature classes as the input. so you shouldn't put it in a loop.

First build a list of feature classes in loop:

#l is a list of featureclasses with absolute path
l = [] 

for r in rows:
 # r is a featureclass like  "D:\FDB.gdb\input1"

arcpy.Merge_management(l, "D:\FGDB.gdb\Merged")
  • Would I name it OSRS_ORN_NER like this?: arcpy.Merge_management(l,"D:\FGDB.gdb\Merged\OSRS_ORN_NER")
    – EmilyF
    Commented Jan 19, 2015 at 14:40
  • 1
    You can name it any thing. Merged is just a sample name of output featureclass in the file geodatabase. you can name it for example OSRS_ORN_NER. Commented Jan 19, 2015 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.