I'm having trouble exporting directly an ArcGIS attribute table to a text file (.txt) while I'm working in ModelBuilder. I tried the followings and none of them worked:
-
Copy Rows tool: I tried to add the (.txt) extension to the output table but it still gave a (.dbf) table.
-
Export Feature Attribute to ASCII: It adds the coordinates (X, Y) which are not needed. Also, the order of the attributes is not the same as the one in the table.
- Export table to Excel: I know that it could work if I export my Excel file to a text file from the Excel panel but I'd prefer having this process completely automatic!
EDIT: LOOK AT THE COMMENTS AT THE BOTTOM
Best Answer
A way of converting an attribute table to a comma separated text file is to run the Table to Table tool. The location would be a folder such as
c:\temp\mydata
and the output table would betest.txt
. If you set the field mappings then you can choose which fields get exported.But you may get yourself into trouble, what happens if a text value contains a comma? Personally I would keep the attribute table in a structured format such as a DBase format as that enforces data integrity. If you have non-roman characters then they may get lost, so a unicode table such as a table in a personal geodatabase is best. Text formats may be simple and easy to understand but a database table takes away the pain...food for thought.