Exporting tables from a geodatabase (gdb) can often be very time consuming, especially when the number of tables is very large. Using the ArcGIS Modelbuilder tool allows you to automatically iterate the process. This short tutorial will help you to export your gdb tables into .csv format automatically.
Open a new session in ArcGIS Model-builder.
Drag the gdb into the session window of your Model-builder. All your files that are within the gdb have now been transferred. Note, shapefiles, rasters etc. that were also part of the gdb were also transferred. When we iterate the tables we will not include these.
Select the table iteration tool (Insert -> Iterations -> Table).
Right click on the ‘Iterate Table’ shape and select your gdb from the dropdown field ‘Workspace’. If you have subfolder within your gdb and you want to make sure that the tables in the subfolder are included in the iteration process, select the ‘Recursive’ box at the bottom of the window. Press ‘ok’ to close the table.
Download the Excel and CSV conversion tool.
In the Model-builder window add the tool (Insert -> brows to the download folder and select the tool -> add). The tool ‘Table ToExcel’ should now be displayed in your Model-builder window.
You need to connect the output file, ‘site’, to the ‘Table ToExcel’ tool. Select the ‘Connect’ tool from the top menu panel in your Model-builder window. Click on the output file (green oval) and then on the ‘Table ToExcel’ tool. A little field will pop up. Click ‘Input Table’. A black/blue arrow should now be linking your output file (green oval) to your ‘Table ToExcel’ tool (yellow box).
The next step is to tell the model that we would like to convert every newly created file (saved in the output file ‘site’ [green oval]) into Excel. First open the ‘Table ToExcel’ tool. Select the Input Table (in my example it would be the green oval called ‘sites’ – Figure 1). Choose the output target folder (the folder in which you want to store the newly created Excel tables). Do not close the window yet!
To make sure that the model maintains all our table names from the gdb when we export the tables, we need to type the following extension into the ‘Output Excel File’ window in the ‘Table ToExcel tool’: ‘%Name%_t’ (include the hyphens!). The ‘%Name%’ tells the model to maintain the names of the gdb tables. The ‘_t’ I included to make sure the model does not override tables (the ‘t’ can be replaced by any letter – I choose ‘t’ because I exported temperature files).
The model is now complete. It’s time to save what you have done!
Validate the model by clicking on the little tick symbol in your Model-builder window (top right next to the blue arrow).
Run the model (blue arrow next to the validate model button). This might take a while depending on how many tables you have (100 tables ca. 8min.).
You should now have all your gdb tables exported as Excel table. Go to your output folder and make sure that all the tables are there.
If you enjoyed this post and would like to learn more about GIS or improve your skills check out our training courses. If you'd like to contribute a story, tutorial or anything else, please contact us.
Thanks for reading and if you'd like to support our content please feel free to buy us a coffee.