Select to view content in your preferred language

Rename Feature Classes in a File Geodatabse

12394
12
Jump to solution
01-11-2017 02:49 AM
alfrednjeru
Deactivated User

I have more than 40 feature classes in a file geodatabase. How do I rename all of them at once by replacing the prefix map212r1 with map208r1.

List Feature Classes

12 Replies
XanderBakker
Esri Esteemed Contributor

Thanks! You already provided the code... I only put it in a simple tool.

JoshuaBixby
MVP Esteemed Contributor

alfredmbungu‌, I suggest you mark Xander's response as the "Correct" answer since it contains the most complete solution. 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

There are a couple options.  One is to copy and paste the code into the interactive Python window in ArcMap or ArcCatalog.  Another is to create a script tool where you could populate some parameters via dialog boxes at runtime.  Developing a script tool may take some learning and time if you are new to Python, so in the near term copying and pasting might work best.

Regarding using IDLE, I am a bit unclear of your steps.  You launch IDLE, obviously, but how are you loading the script into it?  And, how are you running it?  For my script, you will need to replace gdb with a full path to a file geodatabase; otherwise, it won't have anything to act on.