totalTimeToc = time.time() s = totalTimeToc-totalTimeTic m, s = divmod(s, 60) h, m = divmod(m, 60) timeFormat = "%d:%02d:%02d" % (h, m, s) print 'Total time elapsed: ',timeFormat def export_xml(input_path): for root, dirs, files in os.walk(input_path): for f in files: if f.endswith('shp'): inFile = os.path.join(root, f) outFile = os.path.join(importPath[:-11],'exported_fgdc',(f[:-4]+'.xml')) print outFile ws = os.path.join(root) if os.path.isfile(outFile): print 'Removing', outFile os.remove(outFile) print 'Trying to export XML for: ', f arcpy.ExportMetadata_conversion(inFile, translator, outFile) drivePath = find_Drive.main() importPath = r'D:\drive\Map Library Projects\Ramsey County\Shapefiles' translator = "C:\\Program Files\\ArcGIS\\Desktop10.2\\Metadata\\Translator\\ARCGIS2FGDC.xml" export_xml(importPath)
s = totalTimeToc - totalTimeTic m, s = divmod(s, 60) h, m = divmod(m, 60) timeFormat = "%d:%02d:%02d" % (h, m, s) print 'Total time elapsed: ', timeFormat def export_xml(input_path): for root, dirs, files in os.walk(input_path): for f in files: if f.endswith('shp'): inFile = os.path.join(root, f) outFile = os.path.join(root, 'exported_fgdc', (f[:-4] + '.xml')) ws = os.path.join(root) if os.path.isfile(outFile): print 'Removing', outFile os.remove(outFile) print 'Trying to export XML for: ', f arcpy.ExportMetadata_conversion(inFile, translator, outFile) drivePath = find_Drive.main() importPath = r'C:\Users\mart3565\Desktop\Minneapolis data\Shapefiles' translator = "C:\\Program Files\\ArcGIS\\Desktop10.2\\Metadata\\Translator\\ARCGIS2FGDC.xml" export_xml(importPath)