I am trying to change field name of shapefile using AlterField (Management) tool for multiple feature class and multiple field name (same in all fc)
import arcpy
from arcpy import env
env.workspace = r"C:\Users\To Fix.gdb"
for fc in arcpy.ListFeatureClasses("*"):
try:
arcpy.AlterField_management(fc, "Column_Lab","201701E","")
arcpy.AlterField_management(fc, "_1","201701G","")
arcpy.AlterField_management(fc, "_12","201702E","")
arcpy.AlterField_management(fc, "_123","201702G","")
arcpy.AlterField_management(fc, "_1234","201703E","")
arcpy.AlterField_management(fc, "_12345","201703G","")
except:
pass
Nothing happens when I run the script. However when I use
arcpy.AlterField_management(fc, "Column_Lab","","201701E")
It changes the alias successfuly.
Using ArcGIS 10.2 Advance
Code adopted from https://community.esri.com/thread/104033