I want to merge a lot of dbf tables in my “Output” folder, into one table. Here is my code, but it doesn’t work (error showed below).:
JavaScript
x
8
1
import arcpy
2
import os
3
4
arcpy.env.workspace="C:\Users\Desktop\Betty\Output"
5
listTable = arcpy.ListTables ()
6
arcpy.Merge_management (listTable, 'C:\Users\Desktop\Betty\Output\ppt.dbf')
7
print "done!"
8
Traceback (most recent call last): File “C:UserscaobaijingDesktopBettyPythonMergeTables.py”, line 7, in arcpy.Merge_management (listTable, “C:UserscaobaijingDesktopBettyOutputppt.dbf”) File “C:Program Files (x86)ArcGISDesktop10.1arcpyarcpymanagement.py”, line 3762, in Merge raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Datasets: Dataset **does not exist or is not supported Failed to execute (Merge).
Advertisement
Answer
For others who find this, the code works just fine. Must have been a path error or no dbfs in the workspace directory.
JavaScript
1
7
1
import arcpy
2
3
arcpy.env.workspace = 'C:/junk/tables'
4
listTable = arcpy.ListTables()
5
arcpy.Merge_management(listTable, 'C:/junk/tables/ppt.dbf')
6
print "done!"
7