chiark / gitweb /
fix genmarketdata output file format
[ypp-sc-tools.web-live.git] / pctb / yppsc-commod-processor
index 0eb505644636f7d4cb3ccdf5e1bf7fb9bbdb8aab..0f2545201d9de876f9ee5c1d88ff1458724f15a3 100755 (executable)
@@ -307,8 +307,8 @@ sub bs_gen_md ($$) {
         $current= $commod{$commod};
        my $l= bs_p($commod,$bs,$sortmul);
        next unless @$l;
-#print STDERR "COMMOD $commod @$l\n";
-
+#print STDERR "COMMOD $commod  has ".scalar(@$l)."\n";
+       $o .= writeint($commodmap{$commod});
        $o .= writeint(scalar @$l);
        foreach my $cs (@$l) {
            $stall= $cs->{Stall};
@@ -316,12 +316,13 @@ sub bs_gen_md ($$) {
            if (!defined $stallix) {
                push @stallmap, $stall;
                $stallmap{$stall}= $stallix= @stallmap;
+#print STDERR "STALL DEF $stallix $stall\n";
            }
            my $qty= $cs->{Qty};
            $qty =~ s/^\>\s*//;
            $o .= writeint($stallix, $cs->{Price}, $qty+0);
+           $count++;
        }
-       $count++;
     }
 #print STDERR "COMMOD $commod COUNT WAS $count\n";
     return