tcf03 has asked for the wisdom of the Perl Monks concerning the following question:
There is one of these loops for each type of file. There are 5 different types of files. The point of all of this is to grab all lines from like date and time and put them onto one web page, so our application people can have more of an overall view of all logs from the same time period. Currently the process to iterate over each type of file (5), and each type of file can have four or five logs in its history, can take up to 20 minutes. Is there a faster way to do this?for $_(sort @voctable) { open (TMPFILE, "$workdir$_") or die("unable to open $_: $!\n"),br; print "[<font color=\"#ff0000\" size=\"+1\">FILE=$_</font>]\n",br; print hr; while (<TMPFILE>) { print ("<b>$1</b> $2\n",br) if ( m/(.*$MONTH.*$DAY.*$HOUR:$MIN +UTE:\d\d:\d\d\s+20\d\d)(.*)/g ) } close (TMPFILE); }
print ("<b>$1</b> $2\n",br) if ( m/(^....$MONTH..$DAY.$HOUR:$MINUTE:.. +:...20..)(.*)/ )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fast file searching
by BrowserUk (Patriarch) on Apr 12, 2005 at 13:35 UTC | |
by Fletch (Bishop) on Apr 12, 2005 at 13:43 UTC | |
by BrowserUk (Patriarch) on Apr 12, 2005 at 13:55 UTC | |
by Fletch (Bishop) on Apr 12, 2005 at 15:26 UTC | |
by thor (Priest) on Apr 13, 2005 at 00:05 UTC | |
|
Re: Fast file searching
by dragonchild (Archbishop) on Apr 12, 2005 at 13:53 UTC |