Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
* Fixed bug in polling location perl script where headers were not be…
Browse files Browse the repository at this point in the history
…ing output
  • Loading branch information
Jared committed Dec 1, 2011
1 parent c1d5f55 commit 81020b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py/polling_parser.pl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ sub get_date {
);

# output file
open my $wh, ">", "$base_dir/polling_location_mod.txt" or die "$base_dir/polling_location_mod.txt: $!";
open my $wh, ">", "$base_dir/polling_location.txt" or die "$base_dir/polling_location.txt: $!";
my $csv = Text::CSV_XS->new ({
eol => $/,
sep_char => "|"
Expand All @@ -108,9 +108,9 @@ sub get_date {
my @output_line;

# because the reader eats the header, line number starts at '2'
# if ($. == 1) {
# print $wh "$polling_headers" . "\n";
# }
if ($. == 1) {
print $wh "$polling_headers" . "\n";
}

if($csv_line->{'site_type'} eq "P") {
push(@output_line, (
Expand All @@ -126,7 +126,7 @@ sub get_date {
}
}

close $wh or die "localities.txt: $!";
close $wh or die "$base_dir/polling_location.txt: $!";

}

Expand Down

0 comments on commit 81020b3

Please sign in to comment.