Batch Rename Feature Classes?

7126
3
10-23-2013 03:23 AM
LauraKonwinski
New Contributor
Is there a simple script to batch rename 100 feature classes all in the same geodatabase?  I want to add the word "County" to each Feature Class.

Sorry if this seems like a silly question, I'm pretty new to python!

Thanks!
Tags (2)
0 Kudos
3 Replies
LauraKonwinski
New Contributor
Pretty straight forward.

List Feature Classes
http://resources.arcgis.com/en/help/main/10.2/index.html#//018v00000018000000

Rename
http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000056000000


I am trying that but receiving an error.  What would the script be to add "County" to the end of each feature class name?

Thanks!  Like I said, VERY new at this!
0 Kudos
MathewCoyle
Frequent Contributor
1. Set your environment to your geodatabase.
2. Iterate through list of feature classes.
3. For each iteration rename the particular feature class.

Here's an example of using string formatting.
new_name = '{0}_county'.format(fc)
0 Kudos