I am new on Python and using Python within ArcGIS and a bit stuck hoping someone could point me in the right direction.
I want to remove the 6 last characters if the field is longer than 6 characters. I'm using the script in the field calculator.
def doThis(fld): val = 0 if len(fld) > 6: val = fld[len(fld)-6] return val else: val = fld return val Dothis( !Asset_ref!)
With the code above I get a SyntaxError: Invalid syntax (line6)