Great info! Thanks!Only issue now is transferring the values from the old field to the new oneHow do I get the values from the original field to transfer over to the new field?Again, I would ideally like to just rename the field, any ideas on that?I tried addingfield.baseName = "Priority" after the If. Still no luck
try:
arcpy.Statistics_analysis(preparedfeatures, sumstattblnum, "AREA_GEO SUM", "Priority")
except:
for field in fields:
if "Pri" in field.baseName:
if field.baseName != "Priority":
wrongname = field
arcpy.AddWarning('The priority field was named ' + str(field.baseName) + " and will be renamed.")
arcpy.AddField_management(preparedfeatures, "Priority", "SHORT", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
arcpy.CalculateField_management(preparedfeatures, "Priority", field, "PYTHON_9.3", "")
else:
arcpy.AddMessage('%s had the proper fields. There must be some other error.' % preparedfeatures_str)
arcpy.AddWarning(arcpy.GetMessages())
The new field is all 0's rather than the contents of the original 'Priority_1' field.Thoughts?