Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

Resource center export_to_Ascii

share|improve this answer
I didn't know that tool existed. That's very handy to know about. – RyanDalton 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. – Timothy Michael 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. – Timothy Michael 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... This was created by ESRI Professional Services. dixie.lair at gmail dot com

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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