in reply to Re: 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 Date::Simple qw/ today /; my $today = today; my $wk_before = $today - 8; for ($today, $wk_before) { $_ = $_->strftime('%Y%m%d'); } while (<DATA>) { print if $_ ge $wk_before && $_ lt $today; } __DATA__ 20110801-23:42:01,4 20110802-23:42:01,4 20110802-23:45:01,3 20110802-23:48:01,1 20110802-23:51:01,1 20110802-23:54:01,2 20110802-23:57:01,3 20110803-00:00:01,3 20110810-23:42:01,4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Extract data based on dates and place in new file
by dtbach (Novice) on Aug 16, 2011 at 17:30 UTC | |
by Anonymous Monk on Aug 17, 2011 at 02:39 UTC |