HOW TO
In ArcGIS Pro, the General toolset contains tools to perform general data management operations on a geodatabase table or feature class. These modifications can be made by running a Python script in ArcGIS Pro. This article provides the workflow to rename multiple feature classes (as shown in the Catalog pane below) using ArcGIS API for Python.
import arcpy
arcpy.env.workspace = r"<gdbFolderPath>"
for fc in arcpy.ListFeatureClasses() + arcpy.ListTables(): name = fc.split("<separator>")[<maxSplit>] new_name = "<addToFeatureClassName>" + name try: arcpy.management.Rename(fc, new_name) except Exception as e: print(f"Could not rename {fc} to {new_name}: {e}")
The code block below demonstrates the full working script.
import arcpy arcpy.env.workspace = r"C:\Users\ISC-DT27\Documents\Article work\29660\LabelMapFeatures\Portland Labels.gdb" for fc in arcpy.ListFeatureClasses() + arcpy.ListTables(): name = fc.split(" ")[-1] new_name = "Test_" + name try: arcpy.management.Rename(fc, new_name) except Exception as e: print(f"Could not rename {fc} to {new_name}: {e}")
The image below shows the updated feature class names using Python in ArcGIS Pro.
Article ID: 000029660
Get help from ArcGIS experts
Download the Esri Support App