arcpy.TableToGeodatabase_conversion losing text values

1435
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
Could you be running the script in a 32-bit environment on your PC and in a 64-bit environment on your VM server?
0 Kudos
AndrewL
Occasional Contributor II
Hello.

No they are both running 64-bit. Thanks.
0 Kudos
MichaelVolz
Esteemed Contributor
Are you running your scripts through IDLE?
0 Kudos
AndrewL
Occasional Contributor II
No in the windows command prompt. I call the loader.bat file which calls the .ini config file and .py file. Thanks!
0 Kudos
MichaelVolz
Esteemed Contributor
Do you have any error logging included in your python script that could help to identify the problem?
0 Kudos
AndrewL
Occasional Contributor II
There is some error logging. I did not create this script from scratch. I'm doing some modification of an older script my company uses. I am not getting an error. It runs fine.
0 Kudos
MichaelVolz
Esteemed Contributor
Would you be able to send the data and script in a post so I can try it on both a desktop and server?
0 Kudos
AndrewL
Occasional Contributor II
Hello. I can try. Most of the script was written by a private vendor, so I am not sure if I feel comfortable with that. I will try to work up something though.

Also, a schema.ini file is created when running the script on the VM, and not on my PC. It's contents is here. Col 1 and 2 only contain integers. Columns 3,5,7,11,13,15, 17 all have a mix of text and integer values, but only the integer values come through on my VM. Thank you.

[201312daily.txt]
Col3=Tmax Text
Col5=Tmin Text
Col7=Tavg Text
Col11=DewPoint Text
Col13=WetBulb Text
Col15=Heat Text
Col17=Cool Text
0 Kudos
AndrewL
Occasional Contributor II
Hi I have attached the python script and the data file (zip). Thank you for your help! Basically the script extracts the files from the zip file then looks for the .txt file that contains "daily" in the file name, and converts that to geodb table.
0 Kudos