Solved! Go to Solution.
Ok. This works on your sample data.
In Field Calculator...
1. Change parser to python
2. Check Show codeblock
3. Paste the code below into Pre-logic script code
4. in the name = box, enter losemunitype(!name!)def losemunitype( name): lsttypes = ['County', 'Parish', 'Borough', 'Municipality', 'Census Area', 'City and Borough'] for losetype in lsttypes: if losetype in name: return name.replace(losetype, '') return name
def losemunitype( name): lsttypes = ['County', 'Parish', 'Borough', 'Municipality', 'Census Area', 'City and Borough'] for losetype in lsttypes: if name.endswith(losetype): return name[:-len(losetype)].strip() return name