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.
Solved! Go to Solution.
Thanks! You already provided the code... I only put it in a simple tool.
alfredmbungu, I suggest you mark Xander's response as the "Correct" answer since it contains the most complete solution.
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.