2

I am trying to join a shpfile w/ an excel document. Both the shpfile and table have the same number of rows with matching "Unique_Joiner" columns.

Below is the script im running through the IDLE GUI.

ArcGIS 10.4 | Python 2.7

# script to join all feature attributes in dataset with corresponding table.

# IMPORT SYSTEM MODULES

import arcpy
from arcpy import env

#SET WORKSPACE ENVIRONMENT

env.workspace = (r"P:\Miscellaneous ACi\Project_aci_Geodatabase\Texas\2015\shp")

#SET VARIABLES
table = (r"P:\Miscellaneous ACi\Project_aci_Geodatabase\Texas\2015\tables\Texas_C_ply_2015_table")

dataList = arcpy.ListFeatureClasses()
for data in dataList:
    arcpy.JoinField_management(data, "UNIQUE_JOINER", table, "UNIQUE_JOINER")

and ive been getting kickbacks:

Traceback (most recent call last): File "P:\Miscellaneous ACi\Project_aci_Geodatabase\scripts for Luke\3-join.py", line 18, in arcpy.JoinField_management(data, "UNIQUE_JOINER", table, "UNIQUE_JOINER") File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\management.py", line 6098, in JoinField raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000728: Field UNIQUE_JOINER does not exist within table ERROR 000732: Join Table: Dataset P:\Miscellaneous ACi\Project_aci_Geodatabase\Texas\2015\tables\Texas_C_ply_2015_table does not exist or is not supported Failed to execute (JoinField).

Does anyone know why my parameters may be invalid or why the "Unique_Joiner" does not exist within dataset? (My table is saved as .xls).

  • There is no extension/sheet name on your table path variable: "Texas_C_ply_2015_table", for e.g. "Texas_C_ply_2015_table.xls\Sheet$" – artwork21 Dec 22 '16 at 17:54
1

I dont think you can join an excel table to a feature unless you first convert it with Excel To Table:

Converts Microsoft Excel files into a table

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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