I need to capture the start times (only the date without the times) the status and the status report.========== ======== ======= ==== ===== += ====== ================== START TIME END TIME VERSION USER SOURC +E STATUS STATUS DESCRIPTION ========== ======== ======= ==== ===== += ====== ================== August 26, 2004 1:21:04 AM August 26, 2004 1:22:16 AM 2.0 sys +tem HA038974 Pending [BATCHMODE]Started installation pro +cess September 5, 2004 2:49:03 AM September 5, 2004 2:49:37 AM 2.0 + system HA038974 Pending [BATCHMODE]Started installation + process September 16, 2004 12:32:34 PM September 16, 2004 12:33:26 PM 2. +1 [kotzel_sup] HA038974 Pending Started installation proc +ess September 16, 2004 4:44:28 PM September 16, 2004 4:44:34 PM 2.1 + [kotzel_sup] HA038974 Finished 23 Successful, 8 Failed
However, its not working (* what a surprise *) and i think its because the RegEx is not correct.use strict; open(HIST, "c:\\History.log") || die "\n$_ : No log file was found\n"; chomp(my @status = <HIST>); for my $line (@status) { next if ($line =~ /=+|START TIME|^\s+$/); #print "$line\n"; $line =~ /^(.+)\s+\w+\s+(\w+)\s+(.+)$/; print "\n\n$1, \n$2, $3\n\n________________________\n" ; }
In reply to RegEx : Filtering a log file by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |