AnsweredAssumed Answered

search in folders and .gdb and rename featureclass part 2

Question asked by peterverst on Jan 18, 2015
Latest reply on Jan 19, 2015 by peterverst



At the end off part 1 i am able to search folders and Gdb's for featureclasses. for the next part i want to rename a feature in the "feature_class" far i have this:

import os  
import arcpy  

workspace = "D:\GIS\Zone1\Zone1A"
datatypes = "FeatureClass"
arcpy.env.overwriteOutput = True

def inventory_data(workspace, datatypes):  
    for path, path_names, data_names in arcpy.da.Walk(  
            workspace, datatype=datatypes, type="Polygon"):
        for data_name in data_names:  
            yield os.path.join(path, data_name)  
for feature_class in inventory_data(workspace, "FeatureClass"):
    print feature_class
    if feature_class == "RenameTest":
        arcpy.Rename_management("RenameTes2", "RenameTest2")
print feature_class


can sameone point to me were i am going wrong.


thank you and greetings Peter