arcpy.TableToGeodatabase_conversion losing text values

1474
14
01-30-2014 09:50 AM
AndrewL
Occasional Contributor II
I am using the arcpy.TableToGeodatabase_conversion to convert a comma-separated .txt file that I download daily to a table in a geodatabase.

arcpy.TableToGeodatabase_conversion("2013daily.txt", "C:/Users/smith/Desktop/test/all_observations.gdb")


One of the fields in the .txt file contains numbers and text. The above code works in my python script if I am just using the python shell on my PC. It works in that in creates a field in the geodatabase that is text. Therefore it keeps all the values.

However, if I run my python script on the ArcGIS Server VM, it just converts the text values into null. It creates an integer field, and all the text values are lost. I am not sure why this happens on the VM. I am using the same set of data. Thank you.
0 Kudos
14 Replies
MichaelVolz
Esteemed Contributor
Andrew:

I changed some paths for my specific environment and ran your script successfully.  What field is not getting populated correctly?
0 Kudos
AndrewL
Occasional Contributor II
The SnowFall and PrecipTotal fields.

Those fields contain text values 'M' and '  T', but they are lost once I do the tabletogeodb conversion. If I run the script on my VM and look at the geodatabase table, those are now number fields and the values of M and T are now replaced with blank space.

Thanks!
0 Kudos
MichaelVolz
Esteemed Contributor
I have just run your script on a desktop machine with v10.2.  The fields SnowFall and PrecipTotal are being created as Data Type Double and there are blank values, 0 values, and other miscellaneous values from 0.1 to 14.5.  Do those values sound correct from the data you let me test with?
0 Kudos
AndrewL
Occasional Contributor II
Yes that is correct. That is what is happening on my VM. I am running the scipt on my PC using v10.1, and it does not produce blank values.
0 Kudos
MichaelVolz
Esteemed Contributor
I ran the script on a desktop v10.0 machine and got the same results of blank values, 0 values, and other miscellaneous values from 0.1 to 14.5.  There must be some configuration setting on your desktop that is different from all the other machines, at least that's what I'm thinking.
0 Kudos