I have a
.csv with three colums and a point feature class with an empty field that i would like to fill with a value of the csv. In the
.csv i have 15 rows with a code. In the feature class just one row and one of the fields has the same code as one of the codes in the csv.
I want to read the feature class field with code, then read the csv and when it find the same code, change the colum in the csv and read the value corresponding to it. And that value which correspond to the coincident code value insert it in the empty field in the point feature class. By now i was trying to use the SearchCursor and csv reader but it seems it doesn't work but also I get no error.
Does anyone know how to do that?
import csv import arcpy fc = r'C:\Users\Alumno\Desktop\IGP\IGP.gdb\valor' with arcpy.da.SearchCursor(fc,['Com__Forest']) as cursor: ... for row in cursor: ... comarca = 'row ' ... with open (r'C:\Users\Alumno\Desktop\IGP\FWI.csv','rb')as f: ... reader = csv.reader (f,delimiter = ';') ... if row in reader == comarca in row: ... indiceCom = row ... print row 
my problem is that it is the first time i am leading with python and i am terribly lost. From one side i arrange to compare the value on the csv with one difined value of "Comarca" import csv
comarca = '1'
with open (r'D:\ProyectoIGP_Inigo\FWI.csv','rb') as f:
... reader= csv.reader (f,delimiter = ';')
... for row in reader:
... if row == comarca in row:
... indicecom = row
... print indicecom ... 1
Now i need to change that defined value of "comarca = '1'" for and edit cursor or something that lets me introduce the value of row