Hi Jeevan, may be this code would help you.
I tested the code and it works fine. You can specify start and end months that you want to capture the logs from log file. Change the following peice of code to the one which you want.. $2 <= 8) && ($2 >= 7) The format is $2 <= <Month in End Date> && $2 >= <Month in Start Date> ________________________ BEGIN use strict; use File::Copy; use File::Find; open my $R_H, '<', "./log.txt"; while(<$R_H>) { next unless /(\d{1,4})-(\d{1,2})-(\d{1,2})/; if ((($2 <= 8) && ($2 >= 7)) && (($3 >=1) && ($3 <= 31))) { print "$_\n"; } } ____________________________ END. Regrads, Siva On 7/31/07, jeevs <[EMAIL PROTECTED]> wrote: > > Hello forum. > > I am here with a logical problem rather. I have a log file which will > be huge in and can run in MBs. > log file structure is like > > 2007-08-09,0,0,0,0,0,0 > 2007-08-11,0,0,0,0,0,1 > 2007-08-11,0,0,0,0,0,1 > 2007-08-12,0,0,0,2,3,2 > > What I am supposed to do is show the data between particular date > range. > what I have thought so far is to get a two dates for range. > then getting all the dates in between the range into an array and > parsing each line to see if the date is there and print the record. > But my mind says there might be some optimum solution to this. > > At first i tried to use record separator as the starting date but soon > realized if the record to that particular date doesnt exist my program > is dead. > > Right now I am unable to think of anything else. If you can point me > to any module or something logical I can do here . It would be > helpful. > > -- nexis > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > >