I am working on a project where I need to create a tool/method to export the attributes of selected features to a .txt file. I have point features containing addressing information, and the tool would need to export the attributes from one field to a text file.

I have been looking through the ArcPy documentation and found Copy Rows in the Tables Toolset - it can export selected features, but the only output option is exporting to a database table. It seems like this should be a simple task, since exporting to a .txt file is one of the options when manually exporting from a table.

The ultimate goal here is to create a tool and publish it as a geoprocessing service to be used in a web application. I would prefer to find a solution using Python, which I am just beginning to work with and have a little familiarity.

I am currently working with ArcGIS Desktop 10 SP1.


Resource center export_to_Ascii

  • 1
    I didn't know that tool existed. That's very handy to know about. Feb 7 '11 at 16:45
  • I saw that one as well, but it doesn't say if it honors selections on the feature class. I'll give it a try. Feb 7 '11 at 16:59
  • A query wouldn't work, since the user will be doing some sort of spatial select (like dragging a box around points). I accepted your answer because after testing I found that the export_to_ASCII tool does indeed honor selections on the data, and only the attributes of selected features are exported. Thanks for pointing me in the right direction. I'll post my solution later since it may be useful to others. Feb 7 '11 at 20:45

There is an export to .csv function within the Sample .NET Viewer that you may want to take a look at... http://resources.arcgis.com/gallery/file/net-web-adf?page=4& This was created by ESRI Professional Services. dixie.lair at gmail dot com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.