I have exported my contacts into a plain text file and would like to apply a "mask" to certain numbers from certain countries so that they are in a uniform/set pattern e.g:
Below are three USA numbers with different pattern to their numbers.
+1 234 5678901
+13456789012
+1-4567890123
I would like the numbers to end up looking uniformly in the format +c-aaa-nnn-nnnn so the result would be:
+1-234-567-8901
+1-345-678-9012
+1-456-789-0123
Below are three UK numbers with different pattern to their numbers.
+44-7890-123-456
+44 790 123 4567
+44-788-0123456
I would like the numbers to end up looking uniformly in the format +cc-aaaa-nnnnnn so the result would be:
+44-7890-123456
+44-7901-234567
+44-7880-123456
Is there a coding snack that could accomplish this on a text file with numbers in them?
The reason I ask is because my number formatting goes for a loop depending on whether I edit the number in Outlook, on the phone or PDA. If I synchronise, it may be correct on the phone but then the computer contacts either lose some dashes or get spaces added instead of dashes. I know the numbers and dashes don't make a difference on a phone when dialling, but it makes it easier for me to read either on the phone, PDA or computer.
Can anyone help rescue my from my contacts formatting (or lack thereof) nightmare...?