<?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 use Update Cursor to Update Info in Empty field? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511972#M40243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a book that my older brother created for me based on some python class he had that allows me to practice different functions and objects. I got the error that said "&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:/Users/ahutche1/Desktop/lol.py", line 34, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; part1 = row.getValue(address)&lt;/P&gt;&lt;P&gt;AttributeError: 'list' object has no attribute 'getValue'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I edited the code you did a little because I got some errors before:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#import arcpy module
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True 
# I am setting the work path 
env = r'S:\\376\\Summer15-2\\ahutche1\\lab07_data\\SectionB\\'
#I am setting the variable for the hospitals shapefile
hospitals = 'Hospitals'
#I will add a new "FULLAddR" field to the table in the hospitals shapefile
#arcpy.AddField_management(env+hospitals+'.shp','FullAddR', "FLOAT",20)
#I am setting the variable for the new field.
field1 = "FullAddR"
address = "ADDRESS"
city = "CITY"
state = "STATE"
zipcode = "ZIPCODE"
#I will create a cursor to update the FullAddR field
cursor = arcpy.da.UpdateCursor(env+hospitals+'.shp',[field1,address,city,state,zipcode]) 
#I will use a while loop in order to copy all the information from the
 #city,state,address,and zipcode fields into the single FullAddR field.
row = cursor.next() 
while row:
#I am setting the variables for the fields I want to take information from
#in order to merge it into the new field I just created.
&amp;nbsp; part1 = row.getValue(address)&amp;nbsp; 
&amp;nbsp; part2 = row.getValue(city)&amp;nbsp; 
&amp;nbsp; part3 = row.getValue(state)&amp;nbsp; 
&amp;nbsp; part4 = row.getValue(zipcode)&amp;nbsp; 
&amp;nbsp; # Concatenating field values together ( str(part4) is in case zipcode is a numeric field instead of string)&amp;nbsp; 
&amp;nbsp; row.setValue(field1, part1 + " " + part2 + " " + part3 + " " + str(part4))&amp;nbsp; 
&amp;nbsp; cursor.updateRow(row)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; row = cursor.next()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:25:07 GMT</pubDate>
    <dc:creator>fumaniwada1</dc:creator>
    <dc:date>2021-12-11T22:25:07Z</dc:date>
    <item>
      <title>How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511968#M40239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I have a shapefile for hospitals and in the attribute table I added a&amp;nbsp; new field. My goal is to use a while loop and create a search cursor that will merge the data in the address,city,state, and zipcode fields into the new FullAddR field I successfully added. My addfield management code added the field successfully and its blank. But, I think there is something wrong with my update cursor info in the while loop. I'm not sure how to use the row.setValue to merge all the info from the different fields into one if that's even the right direction i should be going in. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#import arcpy module
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True 
# I am setting the work path 
env = r'S:\\376\\Summer15-2\\ahutche1\\lab07_data\\SectionB\\'
#I am setting the variable for the hospitals shapefile
hospitals = 'Hospitals'
#I will add a new "FULLAddR" field to the table in the hospitals shapefile
arcpy.AddField_management(env+hospitals+'.shp','FullAddR', "FLOAT",20)
#I am setting the variable for the new field.
field1 = "FullAddR"
#I am setting the variables for the fields I want to take information from
#in order to merge it into the new field I just created.
address = "ADDRESS"
city = "CITY"
state = "STATE"
zipcode = "ZIPCODE"
#I will create a cursor to update the FullAddR field
cursor1 = arcpy.UpdateCursor(env+hospitals+'.shp') #I swill set up the update cursor
row = cursor1.next()
#I will use a while loop in order to copy all the information from the
#city,state,address,and zipcode fields into the single FullAddR field. 
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(field1,row.getValue(address,city,state,zipcode)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cursor1.next() &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511968#M40239</guid>
      <dc:creator>fumaniwada1</dc:creator>
      <dc:date>2021-12-11T22:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511969#M40240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm curious why are wanting to do this with a cursor and not with a geoprocessing tool such as Calculate Field.&amp;nbsp; You could concatenate together multiple string fields fairly easily with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/calculate-field.htm" title="https://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/calculate-field.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Calculate Field—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While a cursor is a good way to do this as well, I would suggest you use the far easier to use arcpy.da.UpdateCursor.&amp;nbsp; The parameters are slightly different, but they are significantly faster and would be easier to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/updatecursor-class.htm" title="https://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/updatecursor-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;UpdateCursor—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example script for using the arcpy.da.SearchCursor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#import arcpy module&amp;nbsp; 
import arcpy&amp;nbsp; 
from arcpy import env&amp;nbsp; 
arcpy.env.overwriteOutput = True&amp;nbsp;&amp;nbsp; 
# I am setting the work path&amp;nbsp;&amp;nbsp; 
env = r'S:\\376\\Summer15-2\\ahutche1\\lab07_data\\SectionB\\'&amp;nbsp; 
#I am setting the variable for the hospitals shapefile&amp;nbsp; 
hospitals = 'Hospitals'&amp;nbsp; 
#I will add a new "FULLAddR" field to the table in the hospitals shapefile&amp;nbsp; 
arcpy.AddField_management(env+hospitals+'.shp','FullAddR', "FLOAT",20)&amp;nbsp; 
#I am setting the variable for the new field.&amp;nbsp; 
field1 = "FullAddR"&amp;nbsp; 
#I am setting the variables for the fields I want to take information from&amp;nbsp; 
#in order to merge it into the new field I just created.&amp;nbsp; 
address = "ADDRESS"&amp;nbsp; 
city = "CITY"&amp;nbsp; 
state = "STATE"&amp;nbsp; 
zipcode = "ZIPCODE"&amp;nbsp; 
# Starting cursor using with statement to automatically close after completing
with arcpy.da.UpdateCursor(env+hospitals+'.shp' , [field1 , address, city, state , zipcode]) as cursor:
&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Making row[0] aka Full address field equal to address(row[1]) plus city(row[2]) plus state(row[3]) plus zipcode(row[4])
&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = row[1] + " " + row[2] + " " + row[3] + " " + row[4]
&amp;nbsp;&amp;nbsp;&amp;nbsp; #updating current row values(only row[0] has changed and will be updated
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script is untested, but between it and the help, you should get it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:25:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511969#M40240</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-11T22:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511970#M40241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working through a python book and doing different exercises. I already know how to use calculate field but its about learning different things. Is there a way to accomplish this with a while loop? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 14:14:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511970#M40241</guid>
      <dc:creator>fumaniwada1</dc:creator>
      <dc:date>2015-08-19T14:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511971#M40242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Personally, I try to never use while loops unless I absolutely have to.&amp;nbsp; While its good to know how they function(since it looks like you are learning right now), for loops are much safer and can automatically loop through all my features, without telling it to go to the next row manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its good you are expanding your horizons for different ways of doing things(there are about 10 ways to do anything in ArcGIS I was always told), an update cursor is definitely faster than using a geoprocessing tool, if you are doing a large amount of data processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the old style cursor, you set it up correctly, I believe the issue is you need to get each field value individually and then concatentate them into one string before setting it for the new value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;while row:&amp;nbsp; 
&amp;nbsp; part1 = row.getValue(address)
&amp;nbsp; part2 = row.getValue(city)
&amp;nbsp; part3 = row.getValue(state)
&amp;nbsp; part4 = row.getValue(zipcode)
&amp;nbsp; # Concatenating field values together ( str(part4) is in case zipcode is a numeric field instead of string)
&amp;nbsp; row.setValue(field1, part1 + " " + part2 + " " + part3 + " " + str(part4))
&amp;nbsp; cursor.updateRow(row)&amp;nbsp; 
&amp;nbsp; row = cursor1.next()&amp;nbsp; &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May not be the most pythonic way to do it, but it should function.&amp;nbsp; What workbook are you working out of?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:25:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511971#M40242</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-11T22:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511972#M40243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a book that my older brother created for me based on some python class he had that allows me to practice different functions and objects. I got the error that said "&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:/Users/ahutche1/Desktop/lol.py", line 34, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; part1 = row.getValue(address)&lt;/P&gt;&lt;P&gt;AttributeError: 'list' object has no attribute 'getValue'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I edited the code you did a little because I got some errors before:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#import arcpy module
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True 
# I am setting the work path 
env = r'S:\\376\\Summer15-2\\ahutche1\\lab07_data\\SectionB\\'
#I am setting the variable for the hospitals shapefile
hospitals = 'Hospitals'
#I will add a new "FULLAddR" field to the table in the hospitals shapefile
#arcpy.AddField_management(env+hospitals+'.shp','FullAddR', "FLOAT",20)
#I am setting the variable for the new field.
field1 = "FullAddR"
address = "ADDRESS"
city = "CITY"
state = "STATE"
zipcode = "ZIPCODE"
#I will create a cursor to update the FullAddR field
cursor = arcpy.da.UpdateCursor(env+hospitals+'.shp',[field1,address,city,state,zipcode]) 
#I will use a while loop in order to copy all the information from the
 #city,state,address,and zipcode fields into the single FullAddR field.
row = cursor.next() 
while row:
#I am setting the variables for the fields I want to take information from
#in order to merge it into the new field I just created.
&amp;nbsp; part1 = row.getValue(address)&amp;nbsp; 
&amp;nbsp; part2 = row.getValue(city)&amp;nbsp; 
&amp;nbsp; part3 = row.getValue(state)&amp;nbsp; 
&amp;nbsp; part4 = row.getValue(zipcode)&amp;nbsp; 
&amp;nbsp; # Concatenating field values together ( str(part4) is in case zipcode is a numeric field instead of string)&amp;nbsp; 
&amp;nbsp; row.setValue(field1, part1 + " " + part2 + " " + part3 + " " + str(part4))&amp;nbsp; 
&amp;nbsp; cursor.updateRow(row)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; row = cursor.next()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:25:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511972#M40243</guid>
      <dc:creator>fumaniwada1</dc:creator>
      <dc:date>2021-12-11T22:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511973#M40244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are mixing the syntax of the two different types of cursors.&amp;nbsp; Review the documentation for the ArcPy Data Access cursors, paying particular attention to the examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 15:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511973#M40244</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-08-19T15:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511974#M40245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah you are now mixing and matching with the old and new cursors, I wrote that last bit for using the old style cursor(arcpy.UpdateCursor). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how to set it up with a while loop with the new cursors, the old style cursors had a good example with the while that I could use, the new style one does not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 15:14:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511974#M40245</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-08-19T15:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511975#M40246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ahh I see what you are saying! I decided to use the old style cursor like you suggested using the "da"&lt;/P&gt;&lt;P&gt;and I got this error:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:/Users/ahutche1/Desktop/lol.py", line 34, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; part1 = row.getValue(address)&lt;/P&gt;&lt;P&gt;AttributeError: 'list' object has no attribute 'getValue'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#I will create a cursor to update the FullAddR field
with arcpy.da.UpdateCursor(env+hospitals+'.shp',[field1,address,city,state,zipcode]) as cursor: 
#I will use a while loop in order to copy all the information from the
 #city,state,address,and zipcode fields into the single FullAddR field.
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cursor.next() 
&amp;nbsp;&amp;nbsp;&amp;nbsp; while row:
#I am setting the variables for the fields I want to take information from
#in order to merge it into the new field I just created.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part1 = row.getValue(address)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part2 = row.getValue(city)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part3 = row.getValue(state)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part4 = row.getValue(zipcode)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Concatenating field values together ( str(part4) is in case zipcode is a numeric field instead of string)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(field1, part1 + " " + part2 + " " + part3 + " " + str(part4))&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:25:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511975#M40246</guid>
      <dc:creator>fumaniwada1</dc:creator>
      <dc:date>2021-12-11T22:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Update Cursor to Update Info in Empty field?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511976#M40247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are still using the new cursor, you will need to use the old cursor with the syntax you used before to work with the while loop I wrote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14399999946784240 jive_text_macro" data-renderedposition="73_8_912_274" jivemacro_uid="_14399999946784240" modifiedtitle="true"&gt;&lt;UL&gt;&lt;LI&gt;cursor1 = arcpy.UpdateCursor(env+hospitals+&lt;SPAN class="string"&gt;'.shp') &lt;SPAN class="comment"&gt;#I swill set up the update cursor&lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;row = cursor1.next()&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="comment"&gt;#I will use a while loop in order to copy all the information from the&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="comment"&gt;#city,state,address,and zipcode fields into the single FullAddR field.&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;while row:&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="comment"&gt;#I am setting the variables for the fields I want to take information from&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="comment"&gt;#in order to merge it into the new field I just created.&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part1 = row.getValue(address)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part2 = row.getValue(city)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part3 = row.getValue(state)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part4 = row.getValue(zipcode)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment"&gt;# Concatenating field values together ( str(part4) is in case zipcode is a numeric field instead of string)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(field1, part1 + &lt;SPAN class="string"&gt;" " + part2 + &lt;SPAN class="string"&gt;" "&lt;/SPAN&gt; + part3 + &lt;SPAN class="string"&gt;" "&lt;/SPAN&gt; + str(part4))&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 16:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-update-cursor-to-update-info-in-empty/m-p/511976#M40247</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-08-19T16:00:16Z</dc:date>
    </item>
  </channel>
</rss>

