>>> arcpy.env.workspace = r"C:\GIS_Workspace\Projects\Nutrinet_Management_Mapping\NASM_Update\NASMApprovedReport.xls" >>> Tables = arcpy.ListTables() >>> print Tables [] >>>
>>> arcpy.env.workspace = r"C:\GIS_Workspace\Projects\Nutrinet_Management_Mapping\NASM_Update\NASMApprovedReport.xls" >>> Tables = arcpy.ListTables() >>> for tab in Tables: print (tab) >>>
arcpy.env.workspace = r"C:\GIS_Workspace\Projects\Nutrinet_Management_Mapping\NASM_Update\NASMApprovedReport.xls" Tables = arcpy.ListTables() for tab in Tables: arcpy.TableToTable_conversion(tab, r"C:\GIS_Workspace\Python_Scripting\ScratchGDB.gdb", tab)
Solved! Go to Solution.
Since the .xls file is treated like a workspace container the script would look something like: import arcpy xlsPath = r"\\snarf\am\div_lm\ds\gis\projects\workstations\benchmarks\chris\result_tables\merge_20120904.xls" fgdbPath = r"C:\temp\test.gdb" arcpy.env.workspace = xlsPath tableList = arcpy.ListTables() for table in tableList: inTbl = os.path.join(xlsPath,table), outTbl = os.path.join(fgdbPathm, table[0:-1]) #get rid of the traling '$' symbol arcpy.CopyRows(inTbl, outTbl)
>>> import arcpy >>> arcpy.env.workspace = r"C:\GIS_Workspace\Projects\Nutrinet_Management_Mapping\NASM_Update\NASMApprovedReport.xls" >>> Tables = arcpy.ListTables() >>> for tab in Tables: tab = tab[:-1] print tab >>>
>>> import arcpy >>> path = r"C:\GIS_Workspace\Projects\Nutrinet_Management_Mapping\NASM_Update\NASMApprovedReport.xls" >>> arcpy.env.workspace = path >>> tableList = arcpy.ListTables() >>> tableList [] >>>