Exporting to CSV

314
2
08-06-2012 05:38 AM
brittanyschamaun1
New Contributor
I am using model builder to automate a dataset and I can not figure out how to export the data to a csv file. I have a dataset already exporting into kmz files, is there a way to use this same model and export into a csv?

Thanks
0 Kudos
2 Replies
by Anonymous User
Not applicable
This may not be ideal if you only want to export out attributes but it sounds like this may be what you are looking for (this adds coordinate information to output table). You can use the export feature attributes to ascii function in spatial statistics.  You can set the delimiter to commas and add the field names that you wanted to have in the table. Be sure to add the .csv to the name of your output file.  There is a checkbox to add all field names to the output.  There may be better ways out there, but this is the only one I know of and it works for me.  Hope this helps.

arcpy.ExportXYv_stats("Addresses.shp","FULL_ADD", "COMMA","Addresses.csv","ADD_FIELD_NAMES")


Caleb
0 Kudos
brittanyschamaun1
New Contributor
Caleb,
Thanks so much for your help. This is exactly what I needed!
0 Kudos