Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Issues Reading a table from Geodatabase

$
0
0
Hi,

I have scripted a process to read a CSV file into a file geodatabase. Then, I want to read this imported file and work on it by adding new fields and calculating values. However, while using the arcpy.ListTables() on the geodatabase does not list the table.

I am just confused what is wrong.

Any help !!

Here is my script-------------------------

outLocation = dbLoc+'\\'+ out_name +'.gdb'
arcpy.env.workspace = where_tables_are # the folder where your tables are

# Make list of all tables in workspace
tables = arcpy.ListTables("GDB*")

print tables
try:

for tb in tables:
# Execute TableToGeodatabase
print "Importing "+tb+ " to gdb: " + outLocation
arcpy.TableToGeodatabase_conversion(tables, outLocation)

env.workspace = os.path.dirname(os.path.dirname(__file__))+'\\'+ out_name +'.gdb'
arcpy.RefreshCatalog(env.workspace)

inTables = arcpy.ListTables()

Viewing all articles
Browse latest Browse all 2485

Trending Articles