![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Get number ranges from files internally?by brassmon_k (Sexton) |
on Dec 31, 2001 at 20:57 UTC ( #135388=perlquestion: print w/replies, xml ) | Need Help?? |
brassmon_k has asked for the
wisdom of the Perl Monks concerning the following question:
Great Monks of Wisdom I need yours cuz mine ran out, The goal is to go through a particular file that has of course a date and time in it. The date and time are always in the same field for a regex so finding and matching is easy. The problem I'm having is I can't seem to figure out how to match data inside a file. I can match ranges for filenames but I can't seem to get the hang of telling a script okay match a number range internal to a file and grab the line. Here is what the data looks like that I'm matching on. This is an example of one line. All the lines look like this except different numbers etc... but the positions are the same. Now the 5th field $5 is the date of course and the $6 is the time. What I can't figure out is let's say I had like 2000 of these lines and I wanted to get the lines from 00:01:20-00:02:20 and have the lines that were found sent to STDOUT. I can do everything but the number range. Here is my script as of now it will match time and date but only exact time and dates. That's efficient for date since most likely I would search by single days only anyway but the time well that's a problem for me. I can't conceptualize how to do this internally to file. I always just used a range idea on filenames but not inside a file. Here is my script(Of course in it's infant stage yet)....HELP! Any Help would definately be appreciated. HAPPY NEW YEAR! The brassmon_k
Back to
Seekers of Perl Wisdom
|
|