Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UPDATE someTable
- SET someCol = regexp_replace(someCol,'(m[0-9]+)M[ ]+m([a-z]+)M','12','gi')
- WHERE someCol ~* 'm[0-9]+M[ ]+m[a-z]+M'
- m Beginning of word
- ([0-9]+) 1 or more numbers, saved
- M End of word
- [ ]+ 1 or more spaces
- m Beginning of word
- ([a-z]+) 1 or more letters, saved
- M End of word
- 12 A -> 12A
- 1A B -> 1A B
- A1 B -> A1 B
- 12 3 -> 12 3
- 12 A3 -> 12 A3
- # In ArcGIS Field Calculator
- # split address field
- addresslist = address.split()
- # check if last element is an alphabetic character(s) only - no numbers
- if addresslist[-1:].isalpha():
- # build new address here from address list per your requirements
- # this should get you started. Post back if you need help with this part.
- def RemoveWhiteAfterNumber(addressField):
- a = addressField
- for i in range(10):
- a = a.replace( str(i) +" ", str(i))
- return a
- RemoveWhiteAfterNumber(!addressField!)
Add Comment
Please, Sign In to add comment