Nikko Odiseos wrote:

> I am trying to parse the dr watson log and trying to get it so that when 
> it fines the pid that generated an exception it looks from that place in 
> the log and looks for the next instance of the pid string and prints it 
> out. 

Might help if we had a sample of a log file entry or two.  :)

But see below anyway.


> 
> Right now it prints out this:
> 
> App: mmc.exe (pid=2152)
> When: 11/28/2001 @ 11:42:46.513
> 
>  
> 
> But I want it to print out this:
> 
> App: mmc.exe (pid=2152)
> 
> 2152 OUTLOOK.exe
> When: 11/28/2001 @ 11:42:46.513
> 
>  
> 
> What I have so far is this:
> 
>  
> 
> $drwt = "C:/Documents and Settings/All 
> Users.WINNT/Documents/DrWatson/drwtsn32.log";
> print  "<a name=\"drwatson\"></a><br>";
> print   "<b>Dr Watson Log</b><br>";
> if (-e $drwt) {
>      open (DRWTSN, $drwt) ;
>         while (<DRWTSN>) {   
> 
>         foreach $line (<DRWTSN>) {
>                if ($line =~ /App\:/) {
>                print  "<b>$line</b><br>";
>                }
>                if ($line =~ /When\:/) {
>                 print "$line<br>";
>                }
>                if ($line =~ /Exception\Snumber\:/) {

                                         ^^

I would try \s+ above.


>                 print "$line<br><br><br>";
>                }
>           }  
> } 
>  close DRWTSN;
>  }
> 
> else {
> print  "No Dr Watson Log in All Users.WINNT\Documents\DrWatson";
> }
> 
> Thanks for any help!
> 



-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to