Get Address Breakdown From Text / String

Posted on 2009-02-19
Medium Priority
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.

Jody Wood
Question by:JodyWood
  • 2
LVL 26

Expert Comment

by:Anurag Thakur
ID: 23684046
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 Comment

ID: 23684195
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.

Accepted Solution

JodyWood earned 0 total points
ID: 23753030
No solution has been provided. How do I pull my points offered on the question for later use? There should be no points awarded.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
Loops Section Overview
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question