Loading ...
Sorry, an error occurred while loading the content.

21894RE: [Clip] Re: add commas in address string

Expand Messages
  • John Shotsky
    Jul 5, 2011
    • 0 Attachment
      I, for one, always use all 9 digits. (And I'm from before there were even 5 digits!) The first five get you to an area,
      the last 4 get to your house, apt, etc. If the 9 digits are present, your mail can be delivered even without a full
      address present.



      Regards,

      John



      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Eb
      Sent: Monday, July 04, 2011 12:55
      To: ntb-clips@yahoogroups.com
      Subject: [Clip] Re: add commas in address string





      Hi Flo,

      As a bit of trivia, while Wikepedia is correcet, we do indeed have nine digits in our postal code, hardly anyone knows
      what the last four digits are (except bulk mailers, who are required to use all nine digits in order to get the
      so-called "presorted-by-zip-code" discounts in mailing fees).

      The five-digit-only use will most likely remain in wide-spread use until those of us, who learned the original five
      digit sysytem in the 60's (?), are long gone, (or (whisper) until the post office starts to charge extra for not using
      all nine digits, or worse, does not deliver mail without it).

      Result: if one is to write software or clips to deal with zip codes (US Postal Codes), one will have to deal with both
      possibilities.

      Cheers

      Eb

      --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "flo.gehrke" <flo.gehrke@...> wrote:
      >
      > --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , Mike Breiding - Morgantown WV <mike@> wrote:
      > >
      > >
      > > Postal code:
      > > I need to replace the space in front of the first number with a comma
      > >
      > > State abbreviation:
      > > I need to replace the space in front of the first letter with a comma
      > >
      > > City :
      > > I need to replace the space in front of the first letter with a comma
      > >
      > >
      > > 125 N. Main Street City ST 11111
      > >
      > > Then I will paste into Excel
      >
      > I looked it up in Wiki and found that the US Postal Code is a nine-digit ZIP code, separated with '-' between position
      #5 and #6, and there are two spaces between state code and ZIP code -- isn't it?
      >
      > That is, in order to change a list of addresses like...
      >
      > 1500 E. Main Ave Springfield VA 22262-1010
      > 1500 E. Main Ave Springfield VA 22262-1010
      > 1500 E. Main Ave Springfield VA 22262-1010
      >
      > to...
      >
      > 1500 E. Main Ave,Springfield,VA,22262-1010
      > 1500 E. Main Ave,Springfield,VA,22262-1010
      > 1500 E. Main Ave,Springfield,VA,22262-1010
      >
      > you could try...
      >
      > ^!Replace "(?x-i)\x20{1,2} ( ((?=\d{5}-\d{4}$)) | ((?=[[:upper:]]{2},\d{5}-\d{4}$)) |
      ((?=\w{1,},[[:upper:]]{2},\d{5}-\d{4}$)) )" >> "," WARS
      > ; End of long line
      > ^!IfError End
      > ^!Goto Skip_-2
      >
      > It's written in Extended Mode to make the subpatterns more visible.
      >
      > Maybe it's more readable if we split the long alternation into three command lines...
      >
      > ; Match two spaces in front of ZIP code
      > ^!Replace "\x20{2}(?=\d{5}-\d{4}$)" >> "," WARS
      > ; Match one space in front of state code
      > ^!Replace "(?-i)\x20(?=[[:upper:]]{2},\d{5})" >> "," WARS
      > ; Match one space in front of city
      > ^!Replace "(?-i)\x20(?=\w{1,},[[:upper:]]{2},\d{5})" >> "," WARS
      >
      > Regards,
      > Flo
      >





      [Non-text portions of this message have been removed]
    • Show all 25 messages in this topic