Results 1 to 9 of 9

Thread: Address Parse Challange

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    155

    Question Address Parse Challange

    Hi,
    I am looking for a way to parse an address into different parts. I would like to get the street number, street name, street type, city, province/state,postal code/zip, country from an address. The trick is to get that finromation in whatever way the user might enter the address.
    I thought about using Pattern Matching, but it's a little tough for me since I am not all that familiar with it.

    example:

    22-11 streetname streettype (Dr./Street./Avenue/Court, etc..)
    Ottawa, On H4J-5M6

    is one way of writing an address. Other ways might not be as straightforward as this one.

    Could someone help please? I need functions to extract each of the address parts. I need ideas of how to do it at least.

    thanks.

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762
    you can use any seprater between street , state etc

    eg 22-1 , my street , my state...

    etc..

    the other way is typical...
    first u build a db for all street , states etc...

    then search it in the input box when user enter...

    the thrid one easy.. but not full fill ur criterea....
    put stree , state , apt no in seprate boxes

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    155
    Hi,

    I think you misunderstood me. What I am trying to do is read from a Database that already has Address as oe of it's fields where people had already enetred their complete addresses in that field. I am building a new database based on the current one except I want to be able to read in the Address field and seperate it into Street Number, Street Name, Unit Number, Country, City, Province, Street Type, etc.

    Could you help?

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    Unless the format is the same I would say you are out of luck. Probably the best thing that you could acheive would be to be able to pull out the street number (if you can tell it from an apartment number) and the provence.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    155

    Unhappy Maybe and Maybe not

    Well I think there are limited ways that people write their address in.

    I would at least like to try it. I think it can be done with Pattern matching!

    Your ideas would be much appreciated.

    Thanks.

  6. #6
    Lively Member binduau's Avatar
    Join Date
    Sep 2003
    Location
    Perth Australia
    Posts
    121

    Mmmm...... Tricky

    Hi there....
    I did this once i am just trying to think where....

    Maybe you could use a pattern match for the number portion then
    add a marker for every space in the rest of the record , then look for that marker and bung the string from that to the next marker into an array or something while creating an index in the array for that record.

    Alternately you could create a temporary table with an autonumber field as the index. Then loop on the records spilting each record at the marker and adding each item to the fields of your temporary table (which has the fields you want).. You could then open a recordset on that table and loop to add the records created to your table????

    strsomestring = "1234567890" 'pattern match to look for with
    if instr(mystring, strsomestring) then ..........etc...


    i am attaching a file which contains a great many string manipulation functions..

    Keep me posted as to how you get on, as i am very interested, so much so that if i had the time i would try it myself...



    bindu

    Attached Files Attached Files

  7. #7
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    This is what's happens when you have bad database design.

    You should force the user to enter their info in a predictable way. Not allow them to enter it any which way they want.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    155
    HI,

    Yes. I agree. Althought the database I am using was made by someone else!

    agh!!!

  9. #9
    Lively Member binduau's Avatar
    Join Date
    Sep 2003
    Location
    Perth Australia
    Posts
    121

    String manipulation and/or parsing etc.

    Hi There,

    You might find this very useful
    .....


    Go Here For String Examples


    bindu


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width