(cosmetic) Adjust digits in column numbers to fit data
authorBen Ostrowsky <ben@esilibrary.com>
Thu, 18 Nov 2010 16:10:20 +0000 (16:10 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 16 Jul 2012 15:30:08 +0000 (11:30 -0400)
bibliofile/parse_dbd.pl

index 0a16c3a..f72347c 100755 (executable)
@@ -38,7 +38,7 @@ while (<>) {
   for (my $i = 1; $i <= $numcolumns; $i++) {
     my $coltype = substr($dbd, 7*($i-1)+$startOfColumnTypes, 1);
     my $collength = ord substr($dbd, 7*($i-1)+$startOfColumnTypes+1, 1);
-    printf ("Column %02d: %-8s %s (%d chars)\n", $i, $coltypes{$coltype}, $col[$i-1], $collength);
+    printf ("Column %0" . length($numcolumns) . "d: %-8s %s (%d chars)\n", $i, $coltypes{$coltype}, $col[$i-1], $collength);
   }
 
 }