If I were tempted to deal with a mailing list like you describe I'd use this program to clean it up real quick. Then I could go on to other things.
This is faster than the other suggestions you've gotten so far, well for almost every input file. It's especially efficient on larger files, note the not very subtle tricks used to increase speed. Certainly you don't have to go to shell to handle this.
This is probably not quite as good as what Chip might come up with though.
#!/usr/bin/perl -w use strict; my $file = "rawlistfile"; my @eadds; open INPUT, "+>$file" or die "Can't open $file for reading!"; my @eadds = <INPUT>; foreach ( @eadds) { $_ = lc } my $prev; @eadds = sort @eadds; my $cur = $eadds[0]; my $i = 0; while ( $cur le $eadds[-1] ) { print "$prev\n" if $prev ne $cur and $prev; $prev = $curr; $curr = $eadds[++$i]; }
In reply to Eliminating addresses in bulk
by rir
in thread Not case sensitive hash?
by vxp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |