<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mark duplicate features in attribute table with Field Calculator, update to Arc10 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535278#M41927</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've got a handy piece of VB script that I used to routinely run on Arc9.3 to mark duplicate features in an attribute table based upon unique ID's in the table.&amp;nbsp; I typically use this on repeat points that appear within a dataset more than once (based upon ID value, Date/Time and position).&amp;nbsp; The problem is, the script won't work in Arc10 and I wasn't the original author so I'm not sure how to update it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm running Arc10 SP2 on a Windows 7 and/or XP machine.&amp;nbsp; My typical workflow is to concatenate a unique ID 'Unique_ID' (text, 255) based upon several attributes (say ID, Date/Time, Lat./Long).&amp;nbsp; I then create a attribute called 'dup' of a short interger type.&amp;nbsp; I run the field calculator on the dup field and load the following script and what it would normally do is to mark duplicate values of the Unique_ID value with a 1 value.&amp;nbsp; Both records wouldn't be marked, only the second or greater duplicate Unique_ID value record.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Within the field calculator, I'd have the "Show Codeblock" checked and the following in the "Pre-Logic Script Code" area: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Static d As Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Static i As Long&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim iDup As Integer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim sField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'========================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Replace the field name bellow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sField = [Chris_ID] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'========================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If (i = 0) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set d = CreateObject("Scripting.Dictionary")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If (d.Exists(CStr(sField))) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; iDup = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; d.Add CStr(sField), 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; iDup = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i = i + 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following would also be in the bottom part: Dup=iDup&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If someone could help me with updating this VB script for Arc10, it would be greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Sep 2011 01:39:48 GMT</pubDate>
    <dc:creator>ChrisWoodward1</dc:creator>
    <dc:date>2011-09-06T01:39:48Z</dc:date>
    <item>
      <title>Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535278#M41927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've got a handy piece of VB script that I used to routinely run on Arc9.3 to mark duplicate features in an attribute table based upon unique ID's in the table.&amp;nbsp; I typically use this on repeat points that appear within a dataset more than once (based upon ID value, Date/Time and position).&amp;nbsp; The problem is, the script won't work in Arc10 and I wasn't the original author so I'm not sure how to update it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm running Arc10 SP2 on a Windows 7 and/or XP machine.&amp;nbsp; My typical workflow is to concatenate a unique ID 'Unique_ID' (text, 255) based upon several attributes (say ID, Date/Time, Lat./Long).&amp;nbsp; I then create a attribute called 'dup' of a short interger type.&amp;nbsp; I run the field calculator on the dup field and load the following script and what it would normally do is to mark duplicate values of the Unique_ID value with a 1 value.&amp;nbsp; Both records wouldn't be marked, only the second or greater duplicate Unique_ID value record.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Within the field calculator, I'd have the "Show Codeblock" checked and the following in the "Pre-Logic Script Code" area: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Static d As Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Static i As Long&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim iDup As Integer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim sField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'========================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Replace the field name bellow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sField = [Chris_ID] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'========================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If (i = 0) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set d = CreateObject("Scripting.Dictionary")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If (d.Exists(CStr(sField))) Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; iDup = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; d.Add CStr(sField), 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; iDup = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i = i + 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following would also be in the bottom part: Dup=iDup&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If someone could help me with updating this VB script for Arc10, it would be greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 01:39:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535278#M41927</guid>
      <dc:creator>ChrisWoodward1</dc:creator>
      <dc:date>2011-09-06T01:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535279#M41928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is a Python solution. At the moment it returns None for the first value (although you can change this to 0 if you want) and it counts up the duplicates, so the first duplicate is 1, the second is 2 and so on (but you can change that too - just make the line read &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;return 1&lt;/SPAN&gt;&lt;SPAN&gt; instead of &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;return d[inVal]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;Pre-Logic Script Code:&lt;/STRONG&gt;
d = {} # creates an empty dictionary the first time

def findDuplicates(inVal):
 try:
&amp;nbsp; d[inVal] += 1 # works only if this value has been encountered before (is a valid key)
&amp;nbsp; return d[inVal] # returns the number, you could just make this return 1
 except KeyError:
&amp;nbsp; d[inVal] = 0 # if this is the first time, highlight it
&amp;nbsp; return None # or 0...

&lt;STRONG&gt;Expression: dup =&lt;/STRONG&gt;
findDuplicates(!Unique_ID!)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535279#M41928</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2021-12-11T23:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535280#M41929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Stacey, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for your help.&amp;nbsp; I've tried running the script in the field calculator but get an error message "A field name was not found or there were unbalanced quotation marks".&amp;nbsp; Am I doing something wrong?&amp;nbsp; I've copied your script precisely as you have it here for the Pre-Logic Script Code and the Expressionn dup = portion of the script.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 17:06:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535280#M41929</guid>
      <dc:creator>ChrisWoodward1</dc:creator>
      <dc:date>2011-09-14T17:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535281#M41930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Stacy: Just thinking about it, I think a more Pythonic way would be to use a dictionary's built-in setdefault method, which returns a default value if the key isn't found (which works well with cwoodward's issue, I think.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;Pre-Logic Script Code:&lt;/STRONG&gt;
d = {} # creates an empty dictionary the first time

def find_duplicates(in_val):
 d[val] = d.setdefault(val, -1) + 1
 return d[val]

&lt;STRONG&gt;Expression: dup =&lt;/STRONG&gt;
find_duplicates(!Unique_ID!)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Though I find yours more legible!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cwoodward's : I think you need to replace the expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;findDuplicates(!Unique_ID!&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with the expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;findDuplicates(!&lt;STRONG&gt;Chris_ID&lt;/STRONG&gt;!)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if the column with the values you are checking for duplicates is called 'Chris_ID'. In the Python Field Calculator, values surrounded by exclamation marks refer to column names (just like brackets [] in VB code.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535281#M41930</guid>
      <dc:creator>MarcNakleh</dc:creator>
      <dc:date>2021-12-11T23:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535282#M41931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Marc, that's impressive! I haven't come across &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;setdefault&lt;/SPAN&gt;&lt;SPAN&gt; before, but I can see where it might be handy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just noticed that on the module line you had &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;in_val&lt;/SPAN&gt;&lt;SPAN&gt;, but the rest of the module refers to &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;val&lt;/SPAN&gt;&lt;SPAN&gt;. cwoodward, this should work (see attached picture for where to put things; &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;resultsField &lt;/SPAN&gt;&lt;SPAN&gt;is the field the results should go in, &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;numerator &lt;/SPAN&gt;&lt;SPAN&gt;is the field where the duplicates are):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Pre-Logic Script Code:
d = {} # creates an empty dictionary the first time

def find_duplicates(val):
 d[val] = d.setdefault(val, -1) + 1
 return d[val]

Expression: dup =
find_duplicates(!Unique_ID!)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535282#M41931</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2021-12-11T23:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535283#M41932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Stacy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the correction!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2011 11:27:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535283#M41932</guid>
      <dc:creator>MarcNakleh</dc:creator>
      <dc:date>2011-09-15T11:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535284#M41933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for posting that. I modified it to find duplicate points based on same exact X,Y:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Pre-Logic Script Code:
d = {} # creates an empty dictionary the first time

def find_duplicates(valX,valY):
 d[(valX,valY)] = d.setdefault((valX,valY), -1) + 1
 return d[(valX,valY)]

Expression: dup =
find_duplicates( !SHAPE.firstpoint.x!, !SHAPE.firstpoint.y! )&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the 'Feature Vertices to Points' tool, but it produced duplicate points at the common vertices. I couldn't find an out of the box tool to filter them.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535284#M41933</guid>
      <dc:creator>GeorgeNewbury</dc:creator>
      <dc:date>2021-12-11T23:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535285#M41934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to modify this script to simply select the features that are duplicated? It would be helpful to locate dups without the need to add a new field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 11:58:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535285#M41934</guid>
      <dc:creator>RobBlash</dc:creator>
      <dc:date>2012-06-12T11:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535286#M41935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000054000000.htm"&gt;Find Identical&lt;/A&gt;&lt;SPAN&gt; tool will help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 12:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535286#M41935</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-06-12T12:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535287#M41936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I'll take a look. I was hoping to come up with a solution available at all license levels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pre-10 we had a button to bring up a form, choose the field, and select duplicates. I'd like to get that functionality back in 10.1 but of course without VBA.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 12:40:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535287#M41936</guid>
      <dc:creator>RobBlash</dc:creator>
      <dc:date>2012-06-12T12:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535288#M41937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey GIS Users,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to identify duplicate records from a field and then change these fields so they become unique (eg A,B,C, or 1,2,3) and assign this to the end of the text (eg F3241 A56_A or F3241 A56_1).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried the scripts that are in this forum but can't get these to work or not sure if they will give me the result I'm after.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any input into to this would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 05:57:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535288#M41937</guid>
      <dc:creator>ChrisGraves</dc:creator>
      <dc:date>2012-09-19T05:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535289#M41938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I was working with Address Points and had to calculate Spatial Duplicates(same X &amp;amp; Y Coordinates) and Address Duplicates(same attributes). &lt;/SPAN&gt;&lt;STRONG&gt;gnewburyiv&lt;/STRONG&gt;&lt;SPAN&gt; gave the idea and it worked. Gracias. Now, for address duplicates, I need to check for more than two fields(valX, valY, valZ, valA, valB etc.). What can be done in this case. (:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 03:48:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535289#M41938</guid>
      <dc:creator>shivamparashari</dc:creator>
      <dc:date>2014-02-05T03:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535290#M41939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The old "find duplicates" code I was using at 9.x was ported as an addin, thanks to whomever did this work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=2f8c0a2477db465b8ca2a9f7f519eb5a"&gt;http://www.arcgis.com/home/item.html?id=2f8c0a2477db465b8ca2a9f7f519eb5a&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It works great to find attribute duplicates and doesn't require new fields, editing, info license etc. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Actually, I was working with Address Points and had to calculate Spatial Duplicates(same X &amp;amp; Y Coordinates) and Address Duplicates(same attributes). &lt;STRONG&gt;gnewburyiv&lt;/STRONG&gt; gave the idea and it worked. Gracias. Now, for address duplicates, I need to check for more than two fields(valX, valY, valZ, valA, valB etc.). What can be done in this case. (:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To find duplicates amongst many fields you can concatenate the values into one field and then check with the tool I linked above. If you're looking for spatial duplicates in points try using the point distance in toolbox (I think you need an editor or an info license)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 09:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535290#M41939</guid>
      <dc:creator>RobBlash</dc:creator>
      <dc:date>2014-02-05T09:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Mark duplicate features in attribute table with Field Calculator, update to Arc10</title>
      <link>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535291#M41940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;STRONG&gt;rblash&lt;/STRONG&gt;&lt;SPAN&gt; Thanks for the reply. Actually, I am working&amp;nbsp; with ArcGIS 10.0, so the add-in is not working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did this thing in Python-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-style: italic;"&gt;pre-logic script code:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def find_duplicates (valA , valB , valC , valD , valE , valF , valG):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; d[( valA , valB , valC , valD , valE , valF , valG)] = d.setdefault ( ( valA , valB , valC , valD , valE , valF , valG) , -1) +1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return d[ ( valA , valB , valC , valD , valE , valF , valG) ]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-style: italic;"&gt;ObjectID:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;find_duplicates ( !hnr1! , !pc_main! , !city! , !attribdate! , !geocodinga! , !AdminPlace! , !Building_9! )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 10:00:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mark-duplicate-features-in-attribute-table-with/m-p/535291#M41940</guid>
      <dc:creator>shivamparashari</dc:creator>
      <dc:date>2014-02-05T10:00:14Z</dc:date>
    </item>
  </channel>
</rss>

