We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Get Address Breakdown From Text / String

JodyWood
JodyWood asked
on
Medium Priority
681 Views
Last Modified: 2013-12-17
I am looking for c# code and/or addin/utility to take a string and return to me the address information from the string. Here are some examples...

String - Joe Smith, 123 Main St, New York, New York 55555
Returns: Address = 123 Main St.; City = New York; State = New York; ZIP = 55555; ZIP4 = {blank}

String - 1000 W Main Avenue New York, NY 51515-0001
Returns: Address = 1000 W Main; City = New York; State = NY; ZIP = 51515; ZIP4 = 0001

This address string is provided to me in many ways. Sometimes it will have person/business name in it. Sometimes it will just be the address. This address is provided in one long string and I need a tool to break this string into the specifics of the address and the code needs to account for a variety of situations. In some cases, there may be a PO Box and street for the address. In some cases, there may be apartment or suite information. Yes, I need to handle a wide range of possibilities. In some cases, some items may be separated by commas and in others there is nothing separating except a space.

I should also state that I need to break the address into further parts also, such as House Number, House Number Fraction, Direction, Street, Sub Location 1, Sub Location 2, Sub Location 3. Sub Locations would be for apartments, suites, etc. If it code can do basic breakdown and not get to this detail, it may still be acceptable for the application I need to put this into.

Looking forward to your responses.

Thanks,
Jody Wood
Comment
Watch Question

Anurag ThakurTechnical Manager

Commented:
the processing you want to do can only be possible if your string is in one format only
the sample strings you have provided contains data in different formats so thats why the breakdown will be slightly difficult
if the string is in one consistent format then it might be easier even withr egular expressions to do that

Author

Commented:
I understand what you are saying, but that is the challenge I face that it is not always in the same format and I have no control over that. Thus, the challenge at hand.

I know mapping web sites handle this, so there must be a way.
Commented:
No solution has been provided. How do I pull my points offered on the question for later use? There should be no points awarded.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.