summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-11-13 22:51:26 -0800
committerH. Peter Anvin <hpa@zytor.com>2018-11-13 22:51:26 -0800
commitbabeb2b1a794aa7af780f3baff6b523d8bcb5bd1 (patch)
tree28f67f2bee7aa340db6ab77d10a82f3f7ee4e158
parentb28668b5916fa3b0a9a52376a8f08f3bce9464e2 (diff)
downloadballot-babeb2b1a794aa7af780f3baff6b523d8bcb5bd1.tar.gz
ballot-babeb2b1a794aa7af780f3baff6b523d8bcb5bd1.tar.xz
ballot-babeb2b1a794aa7af780f3baff6b523d8bcb5bd1.zip
csvconv.pl: print a summary of empty pages rejected onlyHEADmaster
To keep other errors from disappearing into the noise, print a summary of empty pages rejected rather than spewing an error for each one.
-rwxr-xr-xbin/csvconv.pl10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/csvconv.pl b/bin/csvconv.pl
index 5741f54..55b2d36 100755
--- a/bin/csvconv.pl
+++ b/bin/csvconv.pl
@@ -91,12 +91,17 @@ sub read_csv($) {
@header = split(',', $line);
my $n = 0;
my $nline = 0;
+ my $nblank = 0;
while (defined($line = <$csv>)) {
chomp $line;
$nline++;
my @dline = split(',', $line);
$dline[0] =~ s/^\[\'(.*)\'\]$/\1/;
- if ($dline[1] ne $global_id) {
+ if ($dline[1] eq 'None' && $dline[0] eq 'None' &&
+ $dline[2]) {
+ # Blank page
+ $nblank++;
+ } elsif ($dline[1] ne $global_id) {
error("$file:$nline: Not counting incorrect survey ID: $dline[1]\n");
next;
} elsif (!defined($valid_ids{$dline[0]})) {
@@ -115,6 +120,9 @@ sub read_csv($) {
}
}
close($csv);
+ if ($nblank) {
+ error("$file: $nblank blank pages ignored\n");
+ }
}
($proj) = @ARGV;