chiark / gitweb /
canon: report number of changes to k0
[ypp-sc-tools.main.git] / yarrg / canon
index cb6b980c0189cff0fc5c8e5ccd8bfd3c8dcd98f3..da19de5813c46f611480c0c9d120e5a6c3196346 100755 (executable)
@@ -14,6 +14,8 @@ foreach my $ab (qw(0 1)) {
     close F or die $!;
 }
 print "total rows: ", (scalar keys %s), "\n";
+my $lastk0='';
+my $changek0;
 foreach my $k (sort keys %s) {
     my @r= @{ $s{$k} };
     my $whynot=
@@ -23,7 +25,10 @@ foreach my $k (sort keys %s) {
         $r[1] != $r[3] ? (sprintf "qt %4d",($r[3]-$r[1])) :
         undef;
     next unless $whynot;
+    $k =~ m/\t/;
+    if ($` ne $lastk0) { $lastk0=$`; $changek0++; }
     print $whynot,"\t",$k;
     print "\t", defined($_) ? $_ : "-" foreach @r;
     print "\n";
 }
+print "changes of k0: $changek0\n";