With reference to Check whether any feature classes in multiple gdb's has feature class representation, the code I've mentioned in the other thread is working great for single folder alone. We have 100's of gdb's in different folders & sub-folders.
Since I am very much new to arcpy, I don't know how to do this. I searched & found arcpy.da.walk has to be used to iterate through folders. I've tried that (code below). The code is getting processed but no results or not even throwing any errors. But the process gets completed every time.
Edit:
Based on the comments and code given in this link, i've changed the code
import os
import arcpy
def FindField(fc,myField):
fieldList = arcpy.ListFields(fc,myField)
for field in fieldList:
if str.lower(str(field.name)) == str.lower(myField):
print gdb, fc + " contains fieldname: " + myField
myField = "RuleID"
top_folder = r"W:\RT_QAQC\Received\20160411_GDM_QA\VectorDelivery\RegionalReference"
for path, dirs, files in os.walk(top_folder):
for d in dirs:
if not d.endswith(".gdb"):
continue
gdb_path = os.path.join(path, d)
arcpy.env.workspace = gdb_path
for fc in arcpy.ListFeatureClasses():
FindField(fc,myField)
for fds in arcpy.ListDatasets('','feature'):
for fc in arcpy.ListFeatureClasses('','',fds):
FindField(fc,myField)