I am trying to use the Python Mid() function to return strings starting at the 5th character.
I have tried
!STR_NAME!.Mid(5:20)
but that gives me a traceback error
Can someone point me in the right direction?
Thanks
do it manually (assuming that you have to do this whole process many times)
get it right, then put in the model in order to rule out other stuff like overwriting outputs etc etc.
The error message would also help.
Also python is 0 based so a[:5] will slice the 0, 1, 2, 3, 4 characters, hence :5 means beyond the 5th character
a[5:10] means beyond the 5th and up to, but not including the 10th (5, 6, 7, 8, 9), that is, 5 characters (10 - 5)
Thanks for helping me guys!