3

What would be the most efficient way to export attribute tables from multiple feature class files stored in a file geodatabase? Export to .txt or .csv. Is there any sort of batch process? Or python script?

I have hundreds of files within this geodatabase and really need to automate this process.

asked Apr 8, 2014 at 13:20
1

2 Answers 2

4

With Python, you can use arcpy.ListDatasets to create an object to loop through all the features in your file geodatabase, setting the workspace to the geodatabase first. Then, for each feature use arcpy.MakeTableView_management to create a table view that can then be used by arcpy.TableToExcel_conversion to export the tables to Excel. All of these documentation pages should provide you with enough code snippets to get you there.

answered Apr 8, 2014 at 13:44
3

I just came across CopyRows_management() to convert shapefile attribute tables to csv. For example:

import arcpy
my_shp = 'lat_lon.shp'
out_csv = 'points.csv'
arcpy.CopyRows_management(my_shp, out_csv)
answered May 22, 2017 at 14:26
2
  • 1
    Please, could you elaborate this answer? It could help other users in the future. Commented May 22, 2017 at 15:04
  • 1
    A good answer should include not only what to use, but also how to use it. Please edit your answer to expand on how to use the copyrows_management(). Commented May 22, 2017 at 15:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.