Continuously to Merge shapefiles in folders and subfolders with arcpy I try to edit attribute table for 20 shapefiles that spread in big a folder and are divided to a lot of sub folders. All shapefiles are called "migrashim" and the name of the filed that i want to change is "structuretype". I try this code:
import arcpy,os,sys,string,fnmatch,arcpy.mapping
from arcpy import env
rootPath = r"C:\Project\layers"
pattern = 'migrashim.shp'
features = arcpy.UpdateCursor(r"C:\Project\layers\*.shp")
counter = 0
for root, dirs, files in os.walk(rootPath):
for filename in files:
if filename == "migrashim.shp":
for feature in features:
if feature.structuretype == 3:
feature.structuretype = 4
features.updateRow(feature)
counter = counter + 1
print 'edit'
print counter
del feature,features
but i got an error:
IOError: "C:\Project\layers\migrashim.shp" does not exist
What wrong with my code?