I am trying to figure out how to use fieldName.title() method while updating rows using updateCursor for multiple fields. I was trying to improve the code of this post to fit my purpose:
arcpy.UpdateCursor for multiple fields
def ChangetoTitleCase(sourceTable, fieldNames):
try:
rows=arcpy.UpdateCursor(sourceTable)
for row in rows:
for fieldName in fieldNames:
uField='"%s"' % fieldName
row.setValue(uField, "uField.title()")
rows.updateRow(row)
del row, rows
except Exception, e:
import traceback, sys
tb = sys.exc_info()[2]
print "Line %i" % tb.tb_lineno
print e.message
I am working with Python 2.6.5, ArcPy 10 and Win 7 64. Please let me know where I am wrong?