× 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 Tyra -

>>If it's always the last thing in the field it shouldn't
>>be too hard.  I would extract the last two sets of
>>non-blank characters in the field.
>
>Great idea....any idea on how to extract the last two sets
>of data?

I would use CHECKR to find the last non-blank character, then work to left
looking for a blank.  If I went more than 10 characters, then it is not a
valid U.S. or Canadian zip code, so I would skip the record.  Otherwise, I
would save what I had found in a field and repeat to get the next-to-last
set of non-blank characters.  If the next-to-last is more than 10
characters, I would not save it and just process the field with the last set
of non-blank characters.

Martin had a good idea with translating all letters to A and all digits to
1.  That will make pattern matching a LOT easier.  I would do that against
the extracted fields though, not the whole address field (unless the zip
code is not necessarily at the end).  After translation, if the last field
has ten non-blank characters and is 11111-1111, then it is persumably a U.S.
zip code with zip+4.  If it has five non-blank characters and is 11111, then
it is persumably a U.S. zip code without zip+4.

Ken
Southern Wine and Spirits of Nevada, Inc.
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.