Python

Steve Lamb pmmail@rpglink.com
Tue, 29 Aug 2000 02:38:54 -0700


On Tue, Aug 29, 2000 at 09:44:37AM +0100, David Gaskill wrote:
> It really seems to me to be rather ironic that there is no way for me to
> extract a list of addresses and remove the duplicates, other than by using
> paper and pencil, unless I learn a programming language...

    I don't.  That is a very specific task and not something commonly done.
Blame Microsoft for the lack of decent scripting tools in DOS (batch doesn't
cut it) and the industry's overriding push to make the end user as ignorant as
possible.  I can think of no less than three different ways to do it.  Perl,
Python and simple shell commands.  

    You are correct, if you applied yourself for a few days you might be able
to muster it out.  To be honest, apply yourself.  Knowing at least one decent
scripting language means that when you're hit with these little problems that
have one off solutions you can have the script written and running in about
the same time it would take you to write an email.  Dead serious.  

    I don't find it ironic at all.  Unlike a car a computer is a general
purpose tool that does specific tasks when instructed to do so.  Basic
scripting means your ability to use the machine goes up 1,000% because
"simple", repeatative tasks like this one are the domain of scripting and
basic shell languages.  To me knowing at least the basics of one scripting
language is as much required traning for a computer as taking the appropriate
courses to pass the licensing tests are needed to fully operate a car.

grep *.msg To: > addresses
grep *.msg Cc: >> addresses
<insert favorite editor here to remove first 4 columns of each line, a macro
would do nicely>
sort addresses | uniq > single.addresses

    If I knew awk or sed (forget which) the editor step would not be needed.
That is all you'd need to do it if the tools were provided (which, in a
default Windows and OS/2 installation, they are not).  All of those are from
the command prompt.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------