I found out there is a limitation of 10 characters for field names if you output arcpy.ExcelToTable() to a "in_memory" table.
Why? Is it because dbf format is used?
I dont have this limitation when I use "in_memory" with other tools such arcpy.CopyFeatures_management().
arcpy.ExcelToTable_conversion("C:\\temp\\input.xlsx", "in_memory\table")
Is there a way to use get rid of this limitation with arcpy.ExcelToTable() and "in_memory"?
Solved! Go to Solution.
It appears there is not that limitation when using arcpy.TableToTable_conversion() instead of arcpy.ExcelToTable() but .xlsx is not supported. You will have to use .xls or other formats.
arcpy.TableToTable_conversion("c:\\temp\\input.xls", "in_memory", "table")
Try adding a ValidateFieldName to your workflow to see what it returns since it validates it against the workspace and not the source. So for geodatabase, it would be longer, but in_memory or folder, there is no recommendation, but a shapefile would definitely have a limitation... see this also
http://pro.arcgis.com/en/pro-app/arcpy/get-started/working-with-geodatabases.htm
It appears there is not that limitation when using arcpy.TableToTable_conversion() instead of arcpy.ExcelToTable() but .xlsx is not supported. You will have to use .xls or other formats.
arcpy.TableToTable_conversion("c:\\temp\\input.xls", "in_memory", "table")
If the table is going out to a geodatabase table, but not a dbase table I would assume from the help
http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-table.htm
I really try to avoid long field names unless I absolutely need them, because if the dataset has to go through shapefile at some point (say to export to another software system) your field names will get truncated.
Geoprocessing considerations for shapefile output—Help | ArcGIS Desktop
Good advice, but I prefer to avoid shapefiles, JSON is a better format for sharing data between systems, especially over the net because it's a one file format and can be manipulated by almost every programming language directly.