in reply to Re: Extract the lines from file
in thread Extract the lines from file
In the input file, the values are of 3 day and 2 day old date. I have to extract the time from Suppose date is : Thu Jul 8 2010 This is the inout file,#!/usr/bin/perl use Date::Manip; $ndays=$ARGV[0]; # Get the logs $date = ParseDate("$ndays days ago"); print UnixDate($date,"%m/%d/%Y") . "\n";
Extract the rows, where time is greater than 5/Jul/2010:06:00:00 and less than 6/Jul/2010:10:00:00 So the expected output is :- [5/Jul/2010:00:59:59 +0000] - [5/Jul/2010:00:10:00 +0000] - [5/Jul/2010:06:10:00 +0000] - [5/Jul/2010:06:50:00 +0000] - [5/Jul/2010:07:10:00 +0000] - [5/Jul/2010:10:10:00 +0000] - [6/Jul/2010:06:10:00 +0000] - [6/Jul/2010:07:10:00 +0000] - [5/Jul/2010:08:10:00 +0000] - [5/Jul/2010:06:10:00 +0000] - [5/Jul/2010:09:10:00 +0000] - [5/Jul/2010:10:00:00 +0000] - [5/Jul/2010:10:15:00 +0000]
- [5/Jul/2010:06:10:00 +0000] - [5/Jul/2010:06:50:00 +0000] - [5/Jul/2010:07:10:00 +0000] - [5/Jul/2010:10:10:00 +0000] - [6/Jul/2010:06:10:00 +0000] - [6/Jul/2010:07:10:00 +0000] - [5/Jul/2010:08:10:00 +0000] - [5/Jul/2010:06:10:00 +0000] - [5/Jul/2010:09:10:00 +0000] - [5/Jul/2010:10:00:00 +0000]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Extract the lines from file
by nudge (Acolyte) on Jul 09, 2010 at 07:08 UTC |