deepgis Posted September 3, 2016 Report Share Posted September 3, 2016 Hello to all respected members, I need your help in writing a python code to solve my problem. I want to convert short suffix into long suffix in ArcMap field Calculator(for example in my .dbf table the street name are written as "REITTEN RD" , "E MEEKER ST" and so on . I want to convert these name in new column as "REITTEN ROAD, E MEEKER STREET and so on. kindly help me in writing the code. The link for .dbf table is here- https://www.mediafire.com/?wgqz4ydctwj31w4 regards in advance Quote Link to comment Share on other sites More sharing options...
yousef2233 Posted September 4, 2016 Report Share Posted September 4, 2016 I didnt check your file, but the solution is sth like this fc = "your_featureclass" fields = ["road_name_field"] cursor = arcpy.da.UpdateCursor(fc, fields) for row in cursor: full_name = [] full_name = row[0].split(" ") road_type = full_name[-1] if road_type = "ST": full_name[-1] = "STREET" elif road_type = "RD": full_name[-1] = "ROAD" result= full_name[:-1] result.append(full_name[-1]) row[0]= " ".join(result) cursor.updateRow(row) 3 Quote Link to comment Share on other sites More sharing options...
deepgis Posted September 4, 2016 Author Report Share Posted September 4, 2016 Thank You yousef2233 with regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.