Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing Addresses
Message
De
15/04/2001 00:40:41
 
 
À
13/04/2001 19:14:28
Steven Herbin
SNH Computing Corporation
Swan Lake, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00495481
Message ID:
00495614
Vues:
9
Hey Steven,

Well, there is. I was faced with a situation like this where I had to parse domestic and foreign addresses with no flags to tell me what was what. I eventually did it with a high degree of accuracy, but the code is long lost as I no longer have contact with that client.

If I recall correctly, the algorithm involved word counting. If the last char of the last "word" was a numeric then you had the Zip. Then you had to scan backwards until a blank or comma. That made up the whole Zip. You then dumped that part, including the blank or comma from the string to be evaluated. Now you count back again...kill blank spaces. When you run into non-blanks, assume it's the state if 2-3 chars of non-blanks. Save that somewhere and delete it from the string. Whats left, ALLTRIM()ed, is likely the city.

Hope that made sense :-)


>Does anyone have any examples of address parsing routines?
>
>I have a client whose City State ZIP line is an absolute mess and rather than have them hand code all the changes, I was wondering if the Fox World would have a better way.
>
>Thanks in advance.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform