Sorry about this, but now I have solid proof - and this is an important subtle concept, so bear with me:Your error message stemmed from the line continuation character, this is true; however, it is important to investigate your error messages carefully, as the ERROR 999999 is a generic code. Exercise care with your variable references too, see (along with the attachment) the following interactive IDLE session (I apologize for the readibility; if you are having problems, it may be easier to read if you copy/paste into a text editor - I didn't intend for the text-wrapping as shown below):
>>> # Tables is my ref to the txt...
>>> w = open(Tables, 'r')
>>> for table in w.readlines():
# if I apply the text 'slicing' in the path join part of the process,
# no change is applied where it is also needed for the 'table' var param in TableToTable:
full = os.path.join(source, table[0:-1])
if arcpy.Exists(full):
print 'True'
arcpy.TableToTable_conversion(full, r'C:\Data\base.gdb', table)
print 'success converting: ' + table
else:
print 'False'
True
Traceback (most recent call last):
File "<pyshell#48>", line 5, in <module>
arcpy.TableToTable_conversion(full, r'C:\Data\base.gdb', table)
File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1463, in TableToTable
raise e
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (TableToTable).
>>> # So what just happened??
>>> # This time the table was found, but the conversion could not be completed...same generic error code.
>>> # But if you refresh Catalog, you'll see a strange entry, Table_A with a 'special character' appended.
>>> # This is how the character is interpreted within ArcGIS...notice that the source table was found above...'True' returned.
>>> # BUT, processing halted.
>>> # Try again, this time intervening to redefine the 'table' variable for both the input table source and the output name:
>>> # (The conversion is completed. See the attached illustration that includes the Table_A incomplete table execution.)
>>> w.close()
>>> w = open(Tables, 'r')
>>> for table in w.readlines():
table = table[0:-1]
print "table: " + "'" + table + "'"
full = os.path.join(source, table)
print 'full pathname: ' + "'" + full + "'"
if arcpy.Exists(full):
print 'True - table exists: ' + full
arcpy.TableToTable_conversion(full, r'C:\Data\base.gdb', table)
print 'success converting: ' + table
else:
print 'False'
table: 'Table_A'
full pathname: 'C:\Data\Data.gdb\Table_A'
True - table exists: C:\Data\Data.gdb\Table_A
<Result 'C:\\Data\\base.gdb\\Table_A'>
success converting: Table_A
table: 'Table_B'
full pathname: 'C:\Data\Data.gdb\Table_B'
True - table exists: C:\Data\Data.gdb\Table_B
<Result 'C:\\Data\\base.gdb\\Table_B'>
success converting: Table_B
>>>