× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi David -

Anyone have a routine that will de-standardize a US mailing address?
I don't have a routine but I have a few comments ...

1. Changing the end shouldn't be too hard.  Use %len with %trimr to get the
last non-blank position in the field.

Using %subst with values subtracted from that ending position it would be
easy to change ' ST.', ' St.', ' st.', ' ST', ' St', ' st' to ' Street'.

You could also scan for those values so as to not miss them because of a
following suite or apartment number, but then it gets trickier.  My mother
just moved to '1703 St. James Place'.  You wouldn't want to change that to
'1703 Street James Place'.

2. Changing S to South, N to North, etc. has real dangers as well.  Where I
used to live, there was a big apartment complex with a lot of
streets.  They were all Lanes named after the letters of the alphabet:  A
Lane, B Lane, C Lane, etc.  You wouldn't want to change 'E Lane' to 'East
Lane'.

(In this same town at one time I happened to live on Lane Avenue.  I got a
lot of people looking for [some direction] Lane Avenue when what they
really wanted was E Lane, N Lane, or S Lane in this apartment complex.  I
don't think it went up to W.)

Conclusion: if all of the addresses do exactly follow the Post Office
standardizations, I think a routine could be written that would do a good
job of what you want, including not expanding direction identifiers if they
immediately precede a road type: street, avenue, lane, road, etc.  But I
don't think you could make it fool-proof because fools are so darned ingenious.

Ken
http://www.ke9nr.net/
Opinions expressed are my own and do not necessarily represent the views of
my employer or anyone in their right mind.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.