Parsing a complex address

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Parsing a complex address

Post by abc123 »

I have parsed the following address:

12-13 1/3 A B One Blvd

using the following code:

COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY [7] temp2
CONCAT " " temp2
CONCAT [8] temp2
CONCAT " " temp2
CONCAT [9] temp2
COPY temp2 {SN}
COPY [10] {ST}
CALL Address_Type
EXIT

successfully using PAL. However, I would like some help in parsing all similar addresses. For example, if I have the following addresses:

12-13 1/3 A B One Blvd
14-15 1/2 D Two Blvd
16-17 1/2 Three Blvd

I would like to write one set of code to parse all of these addresses. What I mean is, I might have one or more text tokens between the house number and street type.

I would appreciate any help/hint/comment in this regard.
ashok
Participant
Posts: 43
Joined: Tue Jun 22, 2004 3:04 pm

Post by ashok »

This is what you should do, one set code for all you address examples

^ | - | ^ | ^ | / | ^ | ** | T =A= "BLVD" | $
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY_S [7] temp2
CONCAT temp2 {SN}
COPY [8] {ST}
CALL Address_Type
EXIT
ashok
Participant
Posts: 43
Joined: Tue Jun 22, 2004 3:04 pm

Post by ashok »

small change in code

This is what you should do, one set code for all you address examples

^ | - | ^ | ^ | / | ^ | ** | T =A= "BLVD" | $
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY_S [7] {SN}
COPY [8] {ST}
CALL Address_Type
EXIT
Post Reply