Skip to content

Instantly share code, notes, and snippets.

@renderorange
Created January 7, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renderorange/7ddb8ef16c4b6186445bb27fb50d311f to your computer and use it in GitHub Desktop.
Save renderorange/7ddb8ef16c4b6186445bb27fb50d311f to your computer and use it in GitHub Desktop.
#!/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