I am trying to export feature classes within a geodatabase to CSV format using "Export Feature Attribute to ASCII" in ArCGIS. I am getting the following error
Traceback (most recent call last): File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 159, in export = setupXYV() File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 49, in setupXYV outFieldNames = outFieldNames) File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 129, in exportXYV formatValue = LOCALE.format(localeDict[field], value) File "C:\Python27\ArcGIS10.2\lib\locale.py", line 196, in format return _format(percent, value, grouping, monetary, *additional) File "C:\Python27\ArcGIS10.2\lib\locale.py", line 202, in _format formatted = percent % valueTypeError: not all arguments converted during string formattingHere's the python script I am using
import arcpyfrom arcpy import envimport os, sysarcpy.CheckOutExtension("spatial") arcpy.env.overwriteOutput = True#Set environment settingsworkspace = r'L:\Simulation\Output\PoolVariables.gdb'# Set local variablesoutWorkspace = r'L:\Simulation\Output\CreateCSV'feature_classes = []for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype = "FeatureClass", type = "Point"): for filename in filenames: feature_classes.append(os.path.join(dirpath, filename))#print feature_classes# Loop through feature_classes listtry: for fc in feature_classes: field_names =[f.name for f in arcpy.ListFields(fc)] print field_names #arcpy.ExportXYV_stats(fc, field_names, "COMMA", ) name = os.path.basename(fc) # Extract only the FC basename arcpy.ExportXYv_stats(fc, field_names,"COMMA",name, "ADD_FIELD_NAMES")except: print arcpy.GetMessages()Could someone explain what is happening here? Thank you very much.
أكثر...
Traceback (most recent call last): File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 159, in export = setupXYV() File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 49, in setupXYV outFieldNames = outFieldNames) File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 129, in exportXYV formatValue = LOCALE.format(localeDict[field], value) File "C:\Python27\ArcGIS10.2\lib\locale.py", line 196, in format return _format(percent, value, grouping, monetary, *additional) File "C:\Python27\ArcGIS10.2\lib\locale.py", line 202, in _format formatted = percent % valueTypeError: not all arguments converted during string formattingHere's the python script I am using
import arcpyfrom arcpy import envimport os, sysarcpy.CheckOutExtension("spatial") arcpy.env.overwriteOutput = True#Set environment settingsworkspace = r'L:\Simulation\Output\PoolVariables.gdb'# Set local variablesoutWorkspace = r'L:\Simulation\Output\CreateCSV'feature_classes = []for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype = "FeatureClass", type = "Point"): for filename in filenames: feature_classes.append(os.path.join(dirpath, filename))#print feature_classes# Loop through feature_classes listtry: for fc in feature_classes: field_names =[f.name for f in arcpy.ListFields(fc)] print field_names #arcpy.ExportXYV_stats(fc, field_names, "COMMA", ) name = os.path.basename(fc) # Extract only the FC basename arcpy.ExportXYv_stats(fc, field_names,"COMMA",name, "ADD_FIELD_NAMES")except: print arcpy.GetMessages()Could someone explain what is happening here? Thank you very much.
أكثر...