added HSM corruption tool
[tridge/junkcode.git] / remdups.pl
1 #!/usr/bin/perl -w
2
3
4 #############################################
5 # process a file, translating anything that 
6 # might be an notes email address into internet 
7 # emails
8
9 my $maxgrp1 = 0;
10 my $maxgrp2 = 0;
11 my $culprit = 0;
12 my $culpritN = 0;
13
14 my $ll = 1;
15
16 while (my $line = <>) {
17         chomp $line;
18         my @ids = split(/\,/, $line);
19         my @ids2;
20         my %hash;
21
22         $hash = {};
23
24         if ($#ids > $maxgrp1) {
25                 $maxgrp1 = $#ids;
26         }
27
28         for (my $i=0;$i <= $#ids; $i++) {
29                 my $id = $ids[$i] + 1 - 1;
30                 $hash{$id} = 1;
31         }
32
33         foreach my $i (keys %hash) {
34                 print "$i,";
35         }
36
37         @ids2 = (keys %hash);
38
39         if ($#ids2 > $maxgrp2) {
40                 $maxgrp2 = $#ids2;
41                 $culprit = $ll;
42                 $culpritN = $#ids;
43         }
44
45         print "\n";
46         $ll++;
47 }
48
49 print "maxgrp1=$maxgrp1\n";
50 print "maxgrp2=$maxgrp2\n";
51 print "culprit=$culprit\n";
52 print "culpritN=$culpritN\n";