AnsweredAssumed Answered

TableToExcel - Loop

Question asked by DougHaller on Jun 13, 2017
Latest reply on Jun 19, 2017 by blake.terhune

Hi GeoNet and thanks in advance. I'm new to Python. 

My goal is to write a script that converts all the shapefiles in a gdb into a csv (although I will take an Excel spreadsheet, too).  I plan to convert the final program into a script tool with parameters for which gdb to access and where to save the spreadsheets. I can get a single shapefile to convert into an Excel spreadsheet. I would like to loop through the gdb and convert each shapefile to a unique csv (for this case, let's assume that the gdb contains only shapefiles).

 

My code fails and I have received a couple of different error messages depending on the variable I use for the in_table argument (hope I have that right).  

 

I suspect that I am not correctly naming my in_table and out_xls variables.

 

Here's a screen shot of my code. Sorry for the small size, not sure how to enlarge the text.

 

tabletoexcel loop

Outcomes