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:
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() 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? Thanks in advance for any help!!!