[ale] Code/logic collection question

Chris Fowler ChrisF at computone.com
Mon Apr 23 15:55:05 EDT 2001





How about a C program that uses fgets to read each line.  Use a string function to search for the line and use scanf to extact the correct info.

To get uniqe address, use an array to search for that address. if it is not there, add it.  As the list gets longer, the program will

get slower.  It should provide what you are looking for.




Chris



-----Original Message-----
From: Thompson Freeman [mailto:tfreeman at intel.digichem.net]
To: ale at ale.org
Sent: Monday, April 23, 2001 3:38 PM
To: Atlanta Linux Enthusiasts
Subject: [ale] Code/logic collection question




I needed to collect a large number of email addresses from a colleage of
mine which resided in her mail account. She forwarded the whole bunch to
me, and I appear to have harvested the lot of them, although it was a
messy ad hocery combination of grep, emacs, and pine to get there. (I
saved all of the forwarded messages to a new folder, copied that folder
and started discarding everything which didn't resemble an email address,
and all of the html. I finished up with a pile of hand formatting,
resulting in a column of addresses, one to a line, in the form ->
    name at somewhere <name at somewhere> )


Now, I know that Perl is well adapted to this sort of filtering effort,
but I don't know the language well enough yet to cast my swine before
Perls as it were. I'm pretty sure that "sed" and/or "awk" also have
sufficient power to do the job, but I wasn't especially successful with
either of those tools.


And the question to ask is: <<drumroll please>> "Using normal Unix type
filters and plumbing, extract all unique email addresses from the style
folder pine uses, and place them into a column, one to a row."


I realize this lookes a little like locking the barn after the animals got
out, but I'm looking at it as an exercise in learning and trying to
achieve something like efficiency in my work. If people want, I can try to
synthesize a pine mailfolder with fake names to fiddle with, but that may
take a while.


Thanks to all.


-- 
===========================================
The harder I work, the luckier I get.
                    Lee Iacocca
===========================================
Thompson Freeman          tfreeman at intel.digichem.net



--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.







More information about the Ale mailing list