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]
In reply to Re^2: Extract the lines from file
by Anonymous Monk
in thread Extract the lines from file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |