in reply to Re^3: Extract data based on dates and place in new file
in thread Extract data based on dates and place in new file
#!/usr/bin/perl use strict; use warnings; use POSIX qw/ strftime /; my @dmy = (localtime)[3 .. 5]; # day-month-year my $today = strftime "%Y%m%d", (0) x 3, @dmy; $dmy[0] -= 8; # 8 days before my $wk_before = strftime "%Y%m%d", (0) x 3, @dmy; while (<DATA>) { print if $_ ge $wk_before && $_ lt $today; }
|
|---|