Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Parsing Phone Numbers

Parsing Phone Numbers 11 months 3 weeks ago #18661

I have been trying to find a way to get phone numbers to parse. I am being given lots of different formats from a client for a 10 digit phone number.

Eamples:

1112223333
111-222-3333
(111)2223333
(111) 222 3333
111 222 3333
(111)222-3333
(111) 222-3333

and pobably a couple others I have missed.

My ultimate goal is to get the area code separated from the phone number. I would like the area code as 111, and the phone number as 222-3333. Sometimes we even get a leading 1 because that is what you need to dial for a domestic long distance number.

If anyone could help me figure this out I would greatly appreciate it.

Thank you in advance!

Please Log in or Create an account to join the conversation.

Parsing Phone Numbers 11 months 3 weeks ago #18662

  • admin
  • admin's Avatar
  • Offline
  • Moderator
  • Moderator
  • Deeds not Words
  • Posts: 7618
  • Karma: 33
  • Thank you received: 419
Maybe all you need to do is to gid rid of all characters except numbers than take the first three characters?

111-222-3333 =>1112223333
(111)2223333 =>1112223333
(111) 222 3333 =>1112223333

If it is what you want we can create for you an example
Mike

Please Log in or Create an account to join the conversation.

Parsing Phone Numbers 11 months 3 weeks ago #18663

Yes, if you don't mind, an example would really help. I have tried lots of things and cannot seems to get it right.

Thanks again.

Please Log in or Create an account to join the conversation.

Parsing Phone Numbers 11 months 3 weeks ago #18664

  • admin
  • admin's Avatar
  • Offline
  • Moderator
  • Moderator
  • Deeds not Words
  • Posts: 7618
  • Karma: 33
  • Thank you received: 419
Here is the example.

Mike

Please Log in or Create an account to join the conversation.

Parsing Phone Numbers 11 months 3 weeks ago #18665

  • admin
  • admin's Avatar
  • Offline
  • Moderator
  • Moderator
  • Deeds not Words
  • Posts: 7618
  • Karma: 33
  • Thank you received: 419
Actual transformation is attached for your convenience.

File Attachment:

File Name: Case1_2018-09-26.zip
File Size:8 KB
Mike
Attachments:

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

We have 260 guests and no members online