I have a CSV file called Modifications
. The header has two entries, Rental Object
and Rental Object Name
. The Rental Object
is a string that has matching values in a FGDB feature class where the column is called Property_Ref
. This attribute table also contains a field called Descriptio
. I need to update this Descriptio
with the values from Rental Object Name
in the CSV. The Rental Object
in the CSV and the Property_Ref
match. I'm not sure how to complete this. Below is as far as I've progressed.
# Update Records to be Archived:
import csv, arcpy
fc = "U:/Data/Lease_Plans.gdb/LeasePlans_SAP_NOs_Descs"
Modifications= "U:/Data/Rental_Object_Modifications.csv"
#Read the CSV File
with open(Modifications, 'r') as f:
reader = csv.reader(f)
mydict = dict((rows[0],rows[1]) for rows in reader)
fc_fields = ('Property_Ref','Descriptio')
with arcpy.da.UpdateCursor(fc, fc_fields) as cursor:
for row in cursor:
#Not sure how to structure this.
del cursor
Rental Object
value unique for all rows in the CSV file?