Friday 1 December 2017

arcgis 10.2 - Comparison between two fields of two tables using ArcPy cursors?


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.


enter image description here


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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...