AnsweredAssumed Answered

Removing duplicate values within records

Question asked by tonalca6864 on May 15, 2019
Latest reply on May 15, 2019 by bixb0012

Hi,

 

I got a sample script from an older post but I cannot get it working.

I'm trying to remove duplicate values within records in a FC.

For example, in the first row above, I need to get rid of one "63350" and one "70169" keeping the ";" as delimiters.

 

import arcpy


InputFC = r"H:\PROGRAMMES\10_OTHER_PROJECTS\24_ATTRIBUTION_CHECKS\From_RTJ.gdb\REFID_sample_1_1"
InputField = "REF_ID"

cursor = arcpy.da.UpdateCursor(InputFC, ["REF_ID"])


for row in cursor:

    strList = row.Value(InputField).split("; ")
    strSet = set(strList)

    str = "; "
    conStr = str.join(strSet)

    row.setValue(InputField, conStr)

    cur.updateRow(row)

del row
del cursor

I'm getting an error related to line 12: AttributeError: 'list' object has no attribute 'Value'

 

Any help would be greatly appreciated.

 

Thanks

Outcomes