Hi Rebecca,
this is the code:
import os
import fnmatch
import arcpy
rootPath = r"C:\Project\layers"
pattern = 'mig*.shp'
for root, dirs, files in os.walk(rootPath):
for filename in fnmatch.filter(files, pattern):
shp = os.path.join(root, filename)
if arcpy.ListFields(shp, "YEUD"):
print("{} has YEUD field".format(shp))
with arcpy.da.SearchCursor(shp, ["YEUD"]) as rows:
for row in rows:
if row[0] == 20:
print("{} has a record with YEUD = 20".format(shp))
break