abhirulez

Issues Reading a table from Geodatabase

Discussion created by abhirulez on May 27, 2014
Latest reply on May 28, 2014 by jamesfreddyc
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()

Outcomes