Created
January 7, 2017 20:06
-
-
Save renderorange/7ddb8ef16c4b6186445bb27fb50d311f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my ( $csv, $date_low, $date_high ) = @ARGV; | |
# my $counter = 0; | |
open( my $csv_fh, '<', $csv ) or die "open $csv: $!\n"; | |
foreach my $line ( <$csv_fh> ) { | |
# $counter++; | |
# next if ( $counter == 1 ); | |
chomp( $line ); | |
my @fields = split( ',', $line ); | |
next if ( $fields[0] !~ /^\d+$/ ); | |
print "$fields[1] - $fields[2] $fields[3] - $fields[4]\n" | |
if ( $fields[1] >= $date_low && $fields[1] <= $date_high ); | |
} | |
close( $csv_fh ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment