in reply to How to read each line of file into an array and split contnts of each line into array cells
You do not really need to split the lines to find the time. Extract it with a regex and then print the line unless the time is within 6 hours either side of noon:
use strict; use warnings; abs( 1200 - join "", /(\d\d):(\d\d)/ ) < 600 or print while(<DATA>); __DATA__ **FAILED PROD** - BUGS - 08/26/13 @05:12 - BUGS~23AUG13~23AUG13~23AUG1 +3~26AUG13~ **FAILED PROD** - BUGS - 08/26/13 @11:12 - BUGS~23AUG13~23AUG13~23AUG1 +3~26AUG13~1109 **FAILED PROD** - cockroach - 08/29/13 @11:52 -cockroach~29AUG13~29AUG +13~29AUG13~29AUG13~1152 **FAILED PROD** - cockroach - 08/29/13 @18:00 -cockroach~29AUG13~29AUG +13~29AUG13~29AUG13~1152
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to read each line of file into an array and split contnts of each line into array cells
by Anonymous Monk on Sep 30, 2013 at 12:13 UTC | |
by hdb (Monsignor) on Sep 30, 2013 at 13:07 UTC | |
by Anonymous Monk on Sep 30, 2013 at 12:52 UTC |