I am having a strange problem with the ArcPy Table to Table function. For some reason, when I use the function to create a CSV file in a folder that exists outside of my python project folder, several columns in the CSV file have their headers cut short. For example, I have a column titled "PASSING_400_MICROM" that gets truncated to "PASSING_400_MICR'.
Thus far, I have discovered the following about the problem:
- The truncation of the same column headers appear to occur in any folder, both on my shared network and local machine, that isn't the python project folder. All the headers are truncated to 16 characters in length.
- No truncation occurs if I place the CSV within my project file. (However, I can't do this for the final code, as people on other computers will use my code)
I've done a lot of searching, and I still don't understand why this is happening and how to fix it. I am relatively new to Python and ArcGIS, so I don't even know if I'm searching for the correct things.
What might be causing this problem, and how I can fix it?
Here is an example of the function I am using:
arcpy.TableToTable_conversion(in_rows=DatabaseLocation + '\\Table', out_path=CSVLocation, out_name='Table.csv', where_clause=whereclause)
The same thing happens when I run the tool from it's dialog.