POST
|
Ah, I got it to work with a couple changes. Thank you both for the help! 1. input_features = "ShapeFile.shp" needed the entire path instead of just the file name in order to work with arcpy.ListFields for some reason 2. "if fields.type != ...." needed to be changed to "if f.type != ...."
... View more
04-11-2012
09:44 AM
|
0
|
0
|
515
|
POST
|
Thank you for the reply, but I am really new to python and not sure how that would fit into this: # Export feature locations and attributes to an ASCII text file
# Import system modules
import arcpy
# Local variables...
workspace = "C:\Users\me\Desktop\InputFolder.ospfds"
input_features = "ShapeFile.shp"
export_ASCII = "ExportFile.txt"
try:
# Set the current workspace (to avoid having to specify the full path to the feature classes each time)
arcpy.env.workspace = workspace
# Process: Export Feature Attribute to ASCII...
arcpy.ExportXYv_stats(input_features, ["value_field_A","value_field_B","value_field_C"], "COMMA", export_ASCII, "ADD_FIELD_NAMES")
except:
# If an error occurred when running the tool, print out the error message.
print arcpy.GetMessages()
... View more
04-10-2012
06:07 AM
|
0
|
0
|
515
|
POST
|
Does anyone know a way to export every "Value_Field" in a shape file without specifically using the name of every one individually? In other words is there some kind of wildcard value or loop that will just export every single "Value_Field" that is in the shape file? Based on this: ExportXYv_stats (Input_Feature_Class, Value_Field, Delimiter, Output_ASCII_File, Add_Field_Names_to_Output)
... View more
04-09-2012
09:25 AM
|
0
|
6
|
1201
|
POST
|
Moved to python sub-forum: http://forums.arcgis.com/threads/54804-Export-Feature-Attribute-to-ASCII-question?p=188158#post188158
... View more
04-09-2012
08:28 AM
|
0
|
0
|
758
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|