Need a python script to help with an Append.
My input field length is 254 and my output field length is 25.
So I want the script to still append the data to the new field but can cut it off when it reaches 25 characters.
Is the anyway to do this?
Sample of my script:
import arcpy, sys, os
input_data = arcpy.GetParameterAsText(0)
template = arcpy.GetParameterAsText(1)
arcpy.Append_management(input_data,template,"NO_TEST", "", "")
But this gives me the error.
can we assume you have tried it and it fails with some error message
did you also try to fix the situation by adding a new field to the 25 char table and make it the right size, followed by a simple field calculation to bring over the values into the new field? Then dump the short width field and use the new field in the append.
Any information on what you have tried and what their results were would be useful, since there are obvious workarounds.
Simply assigning the long field to the shorter field my yield errors or truncate in a way you don't want. The field calculation that Dan refers to could be as simple as (using Python syntax)