Select to view content in your preferred language

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

07-27-2016 02:45 PM
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.

0 Kudos
5 Replies
MVP Emeritus

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.

0 Kudos
MVP Honored Contributor

Although I can't vouch for it, this tool promises to do it:

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.

Esri Regular Contributor

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.

0 Kudos
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.

0 Kudos
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.