I am trying to join a csv file to a shapefile based on an ID field that keeps giving me this error:
ExecuteError: ERROR 000210: Cannot create output C:\Users\geo.gdb\2010reg Failed to execute (CopyFeatures).
Here is my code:
import arcpy env.workspace = r"C:\Users\geo.gdb" arcpy.env.qualifiedFieldNames = False # Set local variables for join inFeatures = r'C:\Users\shapefile1.shp' layerName = "ID" joinTable = r"C:\Users\csv1.csv" joinField = "ID" outFeature = r"C:\Users\geo.gdb\successJoined.shp" arcpy.MakeFeatureLayer_management (inFeatures, layerName) # Join the feature layer to a table AddJoin_management(layerName, joinField, joinTable, joinField) # Select desired features from veg_layer# arcpy.SelectLayerByAttribute_management(layerName, "NEW_SELECTION") # Copy the layer to a new permanent feature class arcpy.CopyFeatures_management(layerName, outFeature)
I would like to copy all matched rows to a new output feature class. I do not want it to contain non-matching rows. The key "ID" is the same in both the csv and the shapefile. I am getting the error above that will not allow the final copy to work.