Hi, I'm looking for an elegant python expression that I can be used within ArcMap's field calculator to find all instances of consecutive spaces within a string and replace them with a single space.
Example:
[INDENT]Let's say in a field called "Address" we have the following value (the product of poor concatenation):[/INDENT]
[INDENT]"_123_____Main__St,____Townsville,______CA_98463___"[/INDENT]
[INDENT]It should become "123 Main St, Townsville, CA 98463"[/INDENT]
I know that .strip will get rid of the leading/trailling spaces. How to I get a find/replace approach to continue looping through until all the double-spaces have been reduced to single spaces? Also, I have tried using .split, but get an error in ArcMap that "Field is not Nullable".
Any help would be appreciated.