in reply to Multiple file handles

... 80000 zip codes and they state abbr.

You'll have to double-check this, but I believe that the first three digits of a ZIP code uniquely define a state. The first three digits designate a sectional center facility (SCF), and IIUC such a facility does not service multiple states. E.g., the geographical area of 90210 (Beverly Hills, CA) lies entirely in California and the 902 SCF can only map to CA. (Note, however, that there are both civil and military SCFs.)

Thus, the mapping for all states reduces from 80000 to 1000 SCFs max, an even more manageable hash size. :)


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Multiple file handles
by tybalt89 (Monsignor) on Feb 06, 2023 at 19:57 UTC

    According to the on-line ZIP code file I found, there are four "first three digits" ZIP codes that map to more than one state.

    { 63 => { CT => 39, NY => 1 }, 205 => { DC => 49, VA => 1 }, 739 => { OK => 14, TX => 1 }, 834 => { ID => 44, WY => 1 }, }

    UPDATE: I got the zip codes file from

    https://www.downloadexcelfiles.com/sites/default/files/docs/usazipcode +-1512j.csv

      That's a pretty cool way to do that, I shall play around with that method because honestly the less data I have to reference the better. Thank you!