0

I am using arcgis 10.1 I have two tables A and B need to find attributes of table B data are on the table A I'm doing a join between table A and B now I want to use the field calculator via a script to compare field "name" field of table A and table name B I need help on how to make this script

1 Answer 1

2

If you are checking for duplicate row values between fields, an UpdateCursor is what you want. Attached is a simple script to accomplish this goal. The assumptions here are that you have three fields: FIELD1 (row[0]) and FIELD2 (row[1]) are being compared and the results are recorded in FIELD3 (row[2]), where "1" = duplicate and "0" = unique.

import arcpy fc = r'C:\path\to\your\fc' with arcpy.da.UpdateCursor(fc, ["FIELD1", "FIELD2", "FIELD3"]) as cursor: for row in cursor: if row[0] == row[1]: row[2] = 1 else: row[2] = 0 cursor.updateRow(row) 
1
  • you know how to configure this script for functions modelbuilder and that "fc = R'c: \ path \ to \ your \ fc ' imput be a "shp" Commented Aug 20, 2014 at 16:46

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.