On Sun, Jan 28, 2001 at 10:32:07PM -0500, Charlie Summers wrote:
Folks;
Does anyone know of any pre-existing software for manipulating dist files (i.e. generating per-domain percentages from a dist file, merging two dist files, comparing two dist files, etc., etc)? I suppose anything that dealt specifically with lists of email addresses would work (that is, it doesn't necessarily have to handle the "Only addresses below this line" itself)...anyone have a pointer to such a thing?
I dunno. When I have to do things like this, I haven't had much trouble doing it on the fly. No one may have yet felt the need to write a big whizzy software package for these tasks. You could merge two dist files with "cat dist1 dist2 | sort -u > dist.big", and then fudging "Only addresses below this line." Comparing two dist files is sort dist1 > dist1.sort sort dist2 > dist2.sort diff dist1.sort dist2.sort Per-domain percentages is an interesting one. I would probably do something like this: perl -e 'while (<>) { chomp; if (s/.*@//) { $total++; $domain{$_}++ } }; while (($domain, $count) = each %domain) { printf "$domain: %.02f%%\n", $count * 100.0 / $total }' dist -- Regards, Tim Pierce RootsWeb.com lead system admonsterator and Chief Hacking Officer