So here is a script that is used to extract a specific file from multiple folders and subfolders. It run smooth, until the end.
import os, fnmatch, arcpy arcpy.env.workspace = r'C:\Users\sysadmin\Desktop\DataMagement\Comp_3\SA_MGCP3.gdb' fcMerged = 'MergedFeatureClass' fcClipped = 'Extraction_Mine' fcToClip = r'C:\Users\sysadmin\Desktop\DataMagement\SA.shp filesMatched = list() for root, subfolders, files in os.walk (r'C:\Users\sysadmin\Desktop\DataMagement\MGCP_Raw'): for f in fnmatch.filer(files, 'AAA010.shp'): filesMatched.append(os.path.join(root,f))
Here is the error
arcpy.Merge_managment(filesMatched, fcMerged) arcpy.Clip_analysis(fcMerged, fcToClip, Extraction_Mine)
The error code reads:
Traceback (most recent call last)' File "C:\User\sysadmin\Desktop\test.py", line 17 in < module 7 > arcpy.Merge_management (filesMatched, fcMerged) Attribute error: 'Module' object has no attribute 'Merge_Management'