Hi,
I have a filed in my dataset which is a bit unrorganized. The data contains an adress field with the format: Vollsveien100A.
However, I want to ad a white space between the street name and the housnumber such that the format is: Vollsveien 100A.
Any suggestions?
Kind regards.
Solved! Go to Solution.
Hi,
REGEX_Replace should do the trick. I'm not that familiar with Regex, but if all the addresses are in the same format as the example, I think the formula: REGEX_Replace([Field1], "(\d+)", " " + "$1") should work. It adds white space before every string of characters that have one or more numbers at the beginning. If the address can be in different format, you might have to modify the regex formula.
Hi @olehr ,
use the regex tool with the following command:
(^[[:alpha:]]*)( [[:alpha:]]*)?(\d+)
Cheers
Thanks for the suggestion. That helped :)
Thanks. You should also check @afv2688 answer. I think it is more reliable in case the format can differ.
Hi @afv2688 ,
I am rather unfamiliar with regex, so not quite sure what is going on in the expression that you use. Could you explain ? :)
Best regards
Ole
What the regex tool is doing is something like this:
(^[[:alpha:]]*)( [[:alpha:]]*)?(\d+)
(^[[:alpha:]]*): If the field starts with a word
( [[:alpha:]]*)?: and there is (or maybe not, thats why the question mark is there) another word
(\d+): and in the end is a number
then separate it by
firstword + possible second word + street number
cheers
Thank you so much :)