<?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 Re: How to copy new rows from a shapefile to a feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020426#M59647</link>
    <description>&lt;P&gt;Thanks Dan, I fixed the script.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 11:28:08 GMT</pubDate>
    <dc:creator>MaryamPanji</dc:creator>
    <dc:date>2021-01-27T11:28:08Z</dc:date>
    <item>
      <title>How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1019512#M59615</link>
      <description>&lt;P&gt;Hi, I am trying to add new features from a shapefile to a feature class sitting in database in sql server. Both have common fields but name of a few fields are different.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is that how can I automate this process using&amp;nbsp; a python script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new with Python and I've created this one but I am getting this error:&lt;/P&gt;&lt;P&gt;Runtime error&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 16, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 4, in getPrimaryFieldValues&lt;BR /&gt;TypeError: 'field_names' must be string or non empty sequence of strings.&lt;/P&gt;&lt;P&gt;My script looks like this:&lt;/P&gt;&lt;P&gt;ID is the field that the script should check it if the values don't exist then insert the rows.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;arcpy&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;getPrimaryFieldValues&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;fc&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values&amp;nbsp;=&amp;nbsp;[]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;arcpy.da.SearchCursor(fc,&amp;nbsp;[field])&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;row&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.append(row[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;values&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;getSelectCursor&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;fc&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;whereClause&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;arcpy.da.SearchCursor(fc,&amp;nbsp;[&lt;/SPAN&gt;&lt;SPAN&gt;"*"&lt;/SPAN&gt;&lt;SPAN&gt;],&amp;nbsp;whereClause)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;diff&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;set&lt;/SPAN&gt;&lt;SPAN&gt;(b)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;[aa&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;aa&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;aa&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;not&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;b]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"original"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;destination&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"test"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;fieldName&amp;nbsp;=[&lt;/SPAN&gt;&lt;SPAN&gt;"ID"&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sourceValues&amp;nbsp;=&amp;nbsp;getPrimaryFieldValues(source,&amp;nbsp;fieldName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;destinationValues&amp;nbsp;=&amp;nbsp;getPrimaryFieldValues(destination,&amp;nbsp;fieldName)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;add&amp;nbsp;=&amp;nbsp;diff(sourceValues,destinationValues)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;arcpy.da.InsertCursor(destination,&amp;nbsp;[&lt;/SPAN&gt;&lt;SPAN&gt;"*"&lt;/SPAN&gt;&lt;SPAN&gt;])&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;insertCursor:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;add:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insertRows&amp;nbsp;=&amp;nbsp;getSelectCursor(source,&amp;nbsp;fieldName&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;nbsp;=&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN&gt;(a))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;r&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;insertRows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insertCursor.insertRow(r)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Jan 2021 01:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1019512#M59615</guid>
      <dc:creator>MaryamPanji</dc:creator>
      <dc:date>2021-01-25T01:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1019516#M59616</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - GeoNet, The Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;will get rid of all you sad faces in your code and make it more readable&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;On a quick look, I am not sure if you set up field mapping&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/mapping-fields.htm" target="_blank"&gt;Mapping input fields to output fields—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 01:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1019516#M59616</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-25T01:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1019519#M59617</link>
      <description>&lt;P&gt;I am not sure where you are getting your source and destination field list, but here is a function that I use when we need to do field mapping between two featureclasses. Append might be a better option over cursors, but I don't know the specifics of what you want moved.&amp;nbsp; If you must use cursors, this still might help with getting an idea how to get a list of field names to iterate over.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def fieldMapping(destfc=None, sourcefc=None, keepfields=None):
        """
        Function to assist in making joins by mapping all the fields in the destination fc and
        including a list of fields that is wanted within the source dataset..
        """
        try:
            trglist = [i.name for i in arcpy.ListFields(destfc)]

            # List of fields to keep during Join operation
            fldMap = arcpy.FieldMappings()

            # Creating field maps for the two files
            fldMap.addTable(destfc)
            fldMap.addTable(sourcefc)

            keepfields.extend(trglist)

            # Removing unwanted fields
            for field in fldMap.fields:
                if field.name not in keepfields:
                    fldMap.removeFieldMap(fldMap.findFieldMapIndex(field.name))

            return fldMap

        # Error handling...
        except RuntimeError as e:
            raise Exception("{} failed.\n{}".format(sys._getframe().f_code.co_name, e.message))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the returned field map:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Process: Create the field map for the join
keepfields = ['address', 'zip']
zcodesMap = fieldMapping('destination fc', 'source fc', keepfields)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there are fields that need to be manually mapped, you can so so like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# using the field map created by the function, add the fields that have different names

zcodesMap.addInputField(destfc, 'fieldname in sql')
zcodesMap.addInputField(sourcefc, 'old field name')
usefldmap_name = zcodesMap.outputField
usefldmap_name.name = 'fieldname in sql'
zcodesMap.outputField = usefldmap_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can use the field map in append, join, etc to move your data.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.Append_management(srcAdd, address, "NO_TEST", zcodesMap)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 03:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1019519#M59617</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-01-25T03:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020418#M59645</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;@Anonymous User&amp;nbsp;, I've used cursors cause I wanted to find non-existing rows and then insert them into the feature class. I can change the field names and don't need to do field mapping. There is one field which is unique and I can compare the feature class with the shapefile. if I want to summarise what I want to do is that:&lt;/P&gt;&lt;P&gt;check the shape file based on a field (GeoUnit) and if the values don't exist in GeoUnit of the feature class then insert the rows in feature class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 11:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020418#M59645</guid>
      <dc:creator>MaryamPanji</dc:creator>
      <dc:date>2021-01-27T11:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020425#M59646</link>
      <description>&lt;LI-CODE lang="python"&gt;import arcpy
def getPrimaryFieldValues(fc, field):
	values = []
	with arcpy.da.SearchCursor(fc, [field]) as cursor:
		for row in cursor:
			values.append(row[0])
	return values

def getSelectCursor(fc, whereClause):
	return arcpy.da.SearchCursor(fc, fieldName, whereClause)
	
def diff(a, b):
	b = set(b)
	return [aa for aa in a if aa not in b]

source = "Original"
destination = "Test"
fieldName = ['OBJECTID','F_1','F_2','Description','Class','CatShortDesc','CatLongDesc','Condition','GeoUnit','Easting','Northing','created_user','created_date','last_edited_date','SHAPE@XY','Comments','Class_Code']

sourceValues = getPrimaryFieldValues(source, fieldName)
destinationValues = getPrimaryFieldValues(destination, fieldName)

additions = diff(sourceValues,destinationValues)

with arcpy.da.InsertCursor(destination, fieldName) as insertCursor:
	for a in additions:
		insertRows = getSelectCursor(source, fieldName)
		for r in insertRows:
			insertCursor.insertRow(r)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Jan 2021 11:27:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020425#M59646</guid>
      <dc:creator>MaryamPanji</dc:creator>
      <dc:date>2021-01-27T11:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020426#M59647</link>
      <description>&lt;P&gt;Thanks Dan, I fixed the script.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 11:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020426#M59647</guid>
      <dc:creator>MaryamPanji</dc:creator>
      <dc:date>2021-01-27T11:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy new rows from a shapefile to a feature class</title>
      <link>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020445#M59648</link>
      <description>&lt;P&gt;Thanks for pasting the script.&lt;/P&gt;&lt;P&gt;In your updated code, the whereclause is missing.&amp;nbsp; Using the whereclause in the original pasting, it looks like you were trying to select the fieldname by the sql statement, which will fail because the whereclause is for filtering/selecting the data.&lt;/P&gt;&lt;P&gt;If you are only comparing the one (GeoUnit) field, you only need to grab that value in your lists.&amp;nbsp; I refractored your code a little to:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

def diff(a, b):
    # Filter out existing values
    return [aa for aa in a if aa not in b]

if __name__ == "__main__":
    source = "Original"
    destination = "Test"
    fieldNameList = ['OBJECTID', 'F_1', 'F_2', 'Description', 'Class', 'CatShortDesc', 'CatLongDesc', 'Condition', 'GeoUnit', 'Easting', 'Northing', 'created_user', 'created_date', 'last_edited_date', 'SHAPE@XY', 'Comments', 'Class_Code']

    additions = diff([x[0] for x in arcpy.da.SearchCursor(source, 'GeoUnit')],
                     [x[0] for x in arcpy.da.SearchCursor(destination, 'GeoUnit')])
    
    # iterate over list of GeoUnit values that are not in the featureclass
    for a in additions:
        # select the values in the shapefile based on the whereclause
        whereclause = f"""GeoUnit = '{a}'"""
        with arcpy.da.SearchCursor(source, fieldNameList, whereclause) as cur:
            for row in cur:
                # Insert the values from the shapefile cursor into the fc.
                # The order of the fields in the fieldlist matters here so match their index to the index of the destination FC that you are using.
                with arcpy.da.InsertCursor(destination, fieldNameList) as insertCursor:
                    insertCursor.insertRow(row[0])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps, and that I understood your intention.&amp;nbsp; You could do this with dictionaries as well, so you don't have to iterate over the shapefile a second time but this might work just as well without getting too complex.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-copy-new-rows-from-a-shapefile-to-a-feature/m-p/1020445#M59648</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-01-27T13:49:01Z</dc:date>
    </item>
  </channel>
</rss>

