Any way to convert features and export as csv. or txt. files in batches?

1669
5
07-27-2016 02:45 PM
Highlighted
New Contributor II

Just for study interest, is there any way to convert feature classes and export them as csv. or txt. files in batches?

These are loaded shapefiles. Also would be nice to include their coordinates in the output csv.

Reply
0 Kudos
5 Replies
Highlighted
MVP Esteemed Contributor

anything is possible with scriptting or a model, including the calculation of coordinates prior to export.  If you can do this manually using tools in arctoolbox, then you can pu together a model for future use.  The only thing you have to decide is how much time will this save... an hour or two? many hours?  I will use this daily? that will determine the effort you need to put into the venture.  If you have not used modelbuilder or don't know scripting then you will have to factor that time into yourr decision.

Reply
0 Kudos
Highlighted
MVP Honored Contributor

Although I can't vouch for it, this tool promises to do it: http://www.arcgis.com/home/item.html?id=f3d91b8f852042e289e09a7ec8342431

Other than that, given some Python knowledge, you can somewhat easily write a Python script that will do it for you, but I suppose that's what the tool authors already did.

Highlighted
Regular Contributor II

If you are not into programming you can export entire FGDB into XML format. It only works for FGDB and it is not simple to get only coordinates from this file.

Reply
0 Kudos
Highlighted
New Contributor II

Dan Patterson​​ @Darren Wiens Mody Buchbinder​​ Thanks for the reply.  Actually I am trying to use R to compare different interpolation methods on my yield data. I am writing a script to deal with coordinate conversion, data clean up, data subset and model selection, so it's important to include coordinates in the dataset. The original files are job files from combine harvesters and can only be batched as shapefiles. I have previously used modelbuilder but it can be less straightforward (setting up locations and names etc) for a lot of inputs. There are examples using python to batch export attribute tables but I am not sure whether locations can be included in the output files as well. I don't know much about python but I can learn if necessary.

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

If you already know how to program in R, then I don't think you will have much problems to learn Python, since it is one of the easiest programming languages te learn. Another alternative is to use ModelBuilder (What is ModelBuilder?—Help | ArcGIS for Desktop ) Before you batch export the shapefiles, apply the Add XY Coordinates—Help | ArcGIS for Desktop tool to add POINT_X and POINT_Y  fields to the shapefiles.