So I developed a script that traverses through a root directory, and any subdirectories and catalogs layers files. Then exports these layer files' FGDC metadata and outputs them to a folder. The code at this point is hit/miss sometimes completes and sometimes processes "most" of the input and errors out close to being done.
Can anyone point out what's going on here? Error code is
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py", line 624, in ExportMetadata
raise e
ExecuteError: ERROR 000582: Error occurred during execution.
import arcpy,os arcpy.env.overwriteOutput=True metadataout=r'C:\tmp\out' for dirpath,dirnames,filenames in arcpy.da.Walk(r'C:\folder\files',datatype="Layer"): for filename in filenames: print filename translator = r'C:\Program Files (x86)\ArcGIS\Desktop10.2\Metadata\Translator\ARCGIS2FGDC.xml' arcpy.ExportMetadata_conversion(os.path.join(dirpath,filename),translator,os.path.join(metadataout,str(filename).split(".")[0]+'.xml'))
Solved! Go to Solution.
I was able to resolve the error by using the ESRI Metadata Translator utility instead of the export metadata. If anyone receives this error in the future, you may want to try the translator as well.
I was able to resolve the error by using the ESRI Metadata Translator utility instead of the export metadata. If anyone receives this error in the future, you may want to try the translator as well.