I am a beginner,
I'm not very good at English and I think it's hard to read.
I need a hint
I am new to Python but trying to rename hundreds of feature classes in a geodatabase.
This is the code I have been using that did not work so far:
import arcpy
import os
arcpy.env.workspace = r'C:\Users\WK48.TOKYO\Desktop\ooamisi9_r\01_gdb\ooamisi9.gdb'
lstDatasets = arcpy.ListDatasets()
for dataset in lstDatasets:
lstFCs = arcpy.ListFeatureClasses("*", "", dataset)
for fc in lstFCs:
oldName = str(fc)
newName = oldName.replace("_FG_GML", "")
newName = newName.replace("_0001", "")
arcpy.Rename_management(fc, newName)
I wrote the above code
No change in database