[ale] Code/logic collection question

Jerry Z. Yu z.yu at Ptek.com
Mon Apr 23 16:10:27 EDT 2001


If you only want to garner from standard headers such as FROM/TO, it
should be pretty simple. If you need to grab anything looking like an
email addr whereever it is, then you need to exclude all those
Message-ID:|In-Reply-To: lines. <NOFLAMEPLEASE>perl's regular expression
is most Practical for this type of Extract & Report </NOFLAMEPLEASE>. It
is a replacement of sed/awk/sh/whatever.


 On Mon, 23 Apr 2001, Chris Fowler wrote:

#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
#<mailto:tfreeman at intel.digichem.net> ]
#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.
#
#

Jerry Z. Yu					+1-404-262-8544 (O)
Systems Engineer				https://punch
IS Support, Voicecom,				www.voicecom.com
A business unit of PTEK Holdings, Inc.		www.ptek.com
-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
Manage all your important communications ==\
and information in one place using	 ===>	www.orchestrate.com
Voicecom's Orchestrate service.		 ==/

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





More information about the Ale mailing list