I was trying to manually merge file geodatabase tables and was getting Null values for the output file rows and decided to write a python script to merge the files. Here's my script: import arcpy
from arcpy import env env.workspace = "G:/US county_Climate Hazard models/NWS_County/SUMCounty_NWS_new_frq.gdb" arcpy.env.overwriteOutput = True tableList = arcpy.ListTables() arcpy.Merge_management(tableList, "C:/Documents/ArcGIS/Default.gdb/Merge_sum_freq")
The code takes some time to run but runs without errors. However, when I open ArcMap back again and check for the output, I get duplicate entries in the table I made. Here's how the output looks like:
As you see every entry is duplicated. Could someone explain why is that the case and how could I fix it? Is there something going on with the way I wrote the code?
**EDIT # 1**** I also added:
and I got:
[u'CT_09001', u'CT_09003', u'CT_09005', u'Merge_sum_freq']
(I'm not sure why I get this "u" thing)
**EDIT #2*** The original question is now resolved thanks to Michael Miles-Stimson. I accidentally created Merge_sum_freq inside of SUMCounty_NWS_new_frq.gdb
**EDIT #3 NEW Question * I have a performance related question: every geodatabase table I need to merge has 1 row and 6 fields (including OBJECTID), which you could see on the screenshot I posted. When I run the above script for 10 tables, it runs in 10sec. For 30 tables - 8sec, 264 tables - ~2min. In the end I need to merge >3000 tables (every table with 1 row, so final table will have >3000 rows). Not sure if I'm extrapolating this right, but it seems like they would complete in >20min. Is this considered a good performance? If not, is there any way I could optimize anything?