Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: In-place file filtering

by adrianh (Chancellor)
on Jul 24, 2003 at 21:10 UTC ( #277693=note: print w/replies, xml ) Need Help??


in reply to In-place file filtering

Variation on the theme:

perl -MRegexp::Common=zip -i.bak -n -a -e 'print if m/\t$RE{zip}{US}$/ +' *.dat

Replies are listed 'Best First'.
Re: Re: In-place file filtering
by princepawn (Parson) on Jul 24, 2003 at 22:11 UTC
    from the docs of Regexp::Common::zip
    US zip codes consist of 5 digits, with an optional 4 digit extension

    But this allows zip codes which are not currently valid.

    Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

      Fair point. Might be worth dropping a bug-report/patch to Abigail-II.

      Where do you get the info on which US codes are valid/invalid?

        To actually get the list of zip codes costs money, either from the USPS or other sources. However, by repeatedly typing in zip codes into the zip code locator as USPS.com I found out the valid upper and lower bounds.

        Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

        Your friendly snail-mail corp will sell you same (sorta' -- they'll sell list of valid zips, from which one can deduce the 5 digit #s which are NOT valid.) But bigbuck$$$$.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://277693]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-07-21 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (449 votes). Check out past polls.

    Notices?