Split Phone Number

patel07

New Member
Hi all, just wondering if anybody has come across an issue where they have to split a full uk phone number into area code and tel i.e 01274630000 to 01274 630000 or 01132222222 0113 2222222

Thanks in advanced
 

Pete_L

Active Member
I'm not familiar with UK phone numbers, but I'll assume Area Code is always 5 characters like in your example, and the rest represents the phone #. Let's say the phone # is stored in a text data item called TEST. You can split it into AREA CODE and PHONE using a multi-calc stage:
Step 1: Left([TEST],5) and store in {AREA CODE]
Step 2: Mid([TEST],6,Len([TEST]-5)) and store in [PHONE]
 

patel07

New Member
I'm not familiar with UK phone numbers, but I'll assume Area Code is always 5 characters like in your example, and the rest represents the phone #. Let's say the phone # is stored in a text data item called TEST. You can split it into AREA CODE and PHONE using a multi-calc stage:
Step 1: Left([TEST],5) and store in {AREA CODE]
Step 2: Mid([TEST],6,Len([TEST]-5)) and store in [PHONE]
Hello, Thank you for your suggestion, if only the U.K area codes were as easy as that! the area codes can be 3,4,5 & 6 digits long :rolleyes:
 

Pete_L

Active Member
If the phone number is always the same length, you could reverse my suggestion a bit. Let's say PHONE is always 10 digits (just guessing):
Step 1: Right([TEST],10) and store as [PHONE]
Step 2: The characters from the beginning until Len()-10 would be [AREA CODE].
 

Naraize

New Member
Hey! I've definitely come across this issue before. If you're looking for a quick solution, have you tried using a free uk number splitter tool? I've used one in the past, and it works great! Just input the full phone number, and it'll split it into the area code and tel for you. Saves you time and hassle! Let me know if you need a recommendation, I'd be happy to share. Hope this helps!
 
Last edited:
Top