I've been thinking how to create a shell script to consolidate address lists where the company name is different but the contact name and address are the same. The common element is the e-mail address domain name.
Here's a brief example of the list format: Grabbem & Holdem, LLC Joseph Doe VP 123 Main St. Big City, TX 77002 Email: [email protected] Dewey, Cheatem & Howe, PC Jane Q. Public General Counsel 78 S. Muddy Rd. Coastal, MA 01328 Phone: 617-913-0031 E-mail: [email protected] Fernwave, LLC Joseph Doe VP 123 Main St. Big City, TX 77002 Email: [email protected] What I want to do is move Fernwave, LLC to the line beneath Grabbem & Holdm, LLC and eliminate the second reference to Joe Doe. Now I'm doing this manually in emacs and using 'grep -n domain.com filename' to get a list of all entries with that main domain. I'm sure there's a way to automate this, probably using awk and within a shell script, but despite my research I've not seen a way to do this. It could probably be done with a python script where each entry is put into a dictionary with the company name as a key, but I don't know off-hand how to put all the contact information into the value portion of the dictionary and search for common e-mail domains. This might be a useful tool for others and perhaps someone's already created one. I'm open to suggestions. Rich _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
