import arcpy
arcpy.env.workspace = r"D:\APRX_MXDS\USA_Parcels_2019_Project\Test.gdb"
List_dissolve_fc = arcpy.ListFeatureClasses("*Dissolve")
fields = ["CO_NO", "COUNTY_NAME"]
for fc in List_dissolve_fc:
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
row[1] = "{[-17]}".format(fc)
cursor.updateRow(row)
Hello,
I need to loop through feature classes and in each feature class I need to update the field "COUNTY_NAME" with the name of the feature class. The problem is, that the name of the feature class is too long and I don't need to include the last 17 characters.
For example: "walton_2019pin_Dissolve" is the name of one feature class and I only want to use "walton" in the field names.
As you can see in the script this is written in line 12.
This method is not working.
How could I do this?
Thank you,
Natalia