I am trying to sort through a field in Arcmap, split all records and then update the field with the new values using the UpdateCursor. I have a python script that works, but I can't get it to work using updateCursor. The following is the python script that works, how can I convert this into a format that works with ArcMap.
text = ["xxxStnn549900000xxx", "Stn=0+000000", "STN=0+123"]
Road_Station = [x.lower() for x in text]
Road_Station2 = [y.split('stn') for y in Road_Station]
for item in Road_Station2:
result = ''.join([i for i in item[1] if i.isdigit()])
result = "stn=" + result[0:5]
Stn = result.capitalize()
Stn = Stn[:5] + "+" + Stn[5:8]
print(Stn)