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\Texas2015円\shp")
#SET VARIABLES
table = (r"P:\Miscellaneous ACi\Project_aci_Geodatabase\Texas2015円\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 Luke3円-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\Texas2015円\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).

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Dec 22, 2016 at 16:54
1
  • 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$" Commented Dec 22, 2016 at 17:54

1 Answer 1

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

answered Dec 22, 2016 at 17:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.