HomeBlogPoor Data Entry of Phone Numbers

Poor Data Entry of Phone Numbers

Published February 17, 2004
How many of you out there have phone number fields without any validation or formatting? I did. Today, I wrote a script to go through a database of contacts and "clean up" phone numbers and fax numbers. The script works as follows:
  1. Run through a list of contacts
  2. Remove all non-numeric elements from the #
  3. If it starts with a 1, start the string from the 2nd character
  4. Shorten the string to 10 characters
  5. If there are not 10 character return an empty string
  6. Otherwise, return the phone number without any punctuation
  7. If the phone # is not the same as it was prior to being processed, show the difference on the screen for human analysis
Worked perfectly for this data set. For other datasets, one could parse out extensions and convert letters (for example 1-800-MATTRESS)
blog comments powered by Disqus

1 COMMENT

Ronnie Schwartz is the CTO and founder of RustyBrick, an agile web & mobile development firm that creates effective applications and focuses on finding the right balance between time to production and software quality to get clients in front of their customers quickly and effectively. Ronnie brings over twenty years of innovative design, programming and management expertise to the table.

This article is under Web Programming

There is 1 comment for this post

Connect With Us

Send Us a Message

Do you wish to give us feedback on one of our apps, send us a message or explore a proposal? Fill out the form below and we'll get back to you pronto!

Visit Us

250 West Nyack Road, Suite #200 West Nyack, NY 10994
Get Directions

Call Us Toll Free

877-GO-RUSTY
877-467-8789

Telephone

845-369-6869

Fax

845-228-8177