MACSCRPT Archives

March 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 20 Mar 2009 14:03:21 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (40 lines)
>>>  set aZip to aZip div 100

I was all set to use that until I saw a few dozen zips in the data with
letters: 

027HH    MA
028HH    RI
030HH    NH
040HH    ME

So I'll do something like this:

set aZip to "027HH"
try
    set myZip to aZip div 10
on error
    set myZip to ((characters 1 thru 3 of aZip) as text) as integer
end try


> There are 42 five-digit ZIP codes that cross state lines.    The code should
probably flag those somehow.

Wouldn't you know it, in the first set of live data they're using, one of
those zip codes appears. I'm still hoping I can make this work efficiently
with pure applescript.

>> In those 42 cases, surely the Post Office itself doesn't straddle a state
boundary. Why not use the state in which the Post Office building sits? For
example, 99362's building is in Walla Walla, Washington, though it serves some
rural areas in Oregon. One could additionally flag it as a dual-state zip code,
if desired.

These are for real estate listings, so they'll want to make sure they have
the state the property is located in, and that's particularly important in
border areas, where it seems that most of these shared zips appear.

ES
 

ATOM RSS1 RSS2