Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Python Scripting Problem

$
0
0
Dear Sir
I want to replace "TextString" field attribute values with "Name_Sin" attribute values in an another table.
for that I wrote a script to join two tables and calculate the attributes. But the expression is something wrong.
I have no idea to correct it. So please help me to correct it.

Thanks

Padmasiri

My Script
arcpy.MakeFeatureLayer_management("PCL_Anno", "PCL_Anno_Lyr")
arcpy.AddJoin_management("PCL_Anno_Lyr", "Text", r"C:\CMSupport.gdb\Conv_Tab", "Nam_Idm", "KEEP_ALL")
arcpy.CalculateField_management("PCL_Anno_Lyr", "TextString", "!TextString! = !Name_Sin!", "PYTHON_9.3", "")
arcpy.CopyFeatures_management("PCL_Anno_Lyr", "PCL_Anno_New")

Error Message
Traceback (most recent call last):
File "E:\Gampaha\Scripts\Script1.py", line 89, in <module>
arcpy.CalculateField_management("PCL_Anno_Lyr", "TextString", "!TextString! = !Name_Sin!", "PYTHON_9.3", "")
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3128, in CalculateField
raise e
ExecuteError: ERROR 000539: SyntaxError: invalid syntax (<expression>, line 1)
Failed to execute (CalculateField).

Failed to execute (LISTool1.0).

Viewing all articles
Browse latest Browse all 2485

Trending Articles