Select to view content in your preferred language

arcpy.da.UpdateCursor to concatenate two strings

5666
10
Jump to solution
10-21-2013 09:57 AM
ClintonCooper1
Deactivated User
I am trying to figure out how to concatenate two strings using the arcpy.da.UpdateCursor method (newbie to python scripting).  I have tried many trial and error attempts in the basic code from resource center, and have yet to get one that will work.  Here is the code I am working with:

import arcpy  fc = " C:\Users\cc1\Desktop\Metro_Bus_Stops.shp" fields = ('City','TRIAL')   with arcpy.da.UpdateCursor(fc, fields) as cursor:  in cursor:         row[0] = row[1]         cursor.updateRow(row)  


This code works fine for updating a new field with the current data form another field.  But I cannot get it to concatenate two fields together for the new third field.  Also, I have seen some literature with the ''.join() method, that I am interested in.  I am working with over 7 million records, and every once of performance I can gain is needed.
Tags (2)
0 Kudos
10 Replies
ClintonCooper1
Deactivated User
nope, just in an sde.  I am combining three strings at around 50 to 75 characters.  I have set the field length to 100 characters.  I have a top of the line comp with 16 gb of ram and a 3.8 gb processor (with 10 mb cache).
0 Kudos