I would like to make a comparison between two fields of two different tables with a Python script. Fields for comparison are ROAD_NAME and NAME.ROAD. The idea is to check whether each element of NAME.ROAD field exists in the field ROAD_NAME. Whether it is necessary to check if it has the right DISTRICT, CITY and good in case there is a mistake we must rectify at the tab1 DATA SOURCE : TAB1 --> FGDB TAB2--> Excel
I'm using ArcGIS 10.2 Advanced.
the code that I can write up to now is the following:
cursor1=arcpy.da.SearchCursor("TAB1",("ROAD_NAME","DISTRICT","CITY"))
cursor2=arcpy.da.SearchCursor("TAB2",("NAME.ROAD","DISTRICT","CITY"))
stockage={}
for row in cursor1:
stockage[row[0]]=row[0]
for row in cursor2:
if row[0]==stockage[row[0]]:
pass
else:
....
No comments:
Post a Comment