AnsweredAssumed Answered

Remove first 2 characters using if statement

Question asked by aimong on Aug 9, 2013
Latest reply on Aug 13, 2013 by Caleb1987
Hi, I would like to have this code remove and XY or RR (if they are the first 2 characters) in a field with values

XY2365541
RR1247884
8965445

would be:

2365541
1247884
8965445

Writing a query is giving me trouble. I was trying this code with a search cursor, getvalue and if elif statement...but no luck

import arcpy Feature_Class_Name = arcpy.GetParameterAsText(0) Output_Features = arcpy.GetParameterAsText(1) arcpy.env.workspace = r"H:/TestMDB.gdb/XY_1"  cursor = arcpy.da.UpdateCursor(Feature_Class_Name, ["NM"]) for row in cursor:     cursor.updateRow([row[0][2:]]) del fc

Outcomes