DKP Log Parser Forum Index
 Forum FAQ   Search   Register   Log in 
 About   Download   Forum   Wiki   Development
loot string problem in dklp

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Patterns

Author

Message

Bat



Joined: 08 Aug 2007
Posts: 4

PostPosted: Wed Aug 08, 2007 11:29 am    Post subject: loot string problem in dklp

Reply with quote


I'm setting up a pattern to recognise loot commands given a channel called test by anyone in it.

the lines that should be recognised look like (EQ1 logs)
Code:

[Tue Jun 01 21:00:00 2007] You tell test:1, 'loot char1 - item1 - 10'


but for some reason the pattern filled in in the preferences, doesn't seem to pick it up.
Code:

\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})\].*?tell.{1,2}test:\d+.*?[Ll]oot (\w+) - (.*?) - (\d+)'


The pattern gives the correct result if I use it in the following perl-script.

Code:

#!/freeware/bin/perl

$infilename=$ARGV[0];
$outfilename=$ARGV[1];

#$infilename="something.in";
#$outfilename="something.out";

open(IN,$infilename);
open(OUT,">$outfilename");

while ($_=<IN>){
    $tmp=$_;
    if ($tmp =~ m/\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})\].*?tell.{1,2}test:\d+.*?[Ll]oot (\w+) - (.*?) - (\d+)'/)
    {
   print "found\n";
    }
    else{
   print"nada\n";
    }
}


Am I missing something (perl vs java?) or did I stumble on a parsing bug ?
(word wrapping is messing up the code a bit, patterns are on a single line).

Back to top

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Wed Aug 08, 2007 8:35 pm    Post subject: Re: loot string problem in dklp

Reply with quote


Bat wrote:
the lines that should be recognised look like (EQ1 logs)
Code:

[Tue Jun 01 21:00:00 2007] You tell test:1, 'loot char1 - item1 - 10'


but for some reason the pattern filled in in the preferences, doesn't seem to pick it up.
Code:

\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})\].*?tell.{1,2}test:\d+.*?[Ll]oot (\w+) - (.*?) - (\d+)'



It does pick up
Code:
[Tue Jun 01 21:00:00 2007] You tell test:1, 'loot char - item1 - 10'

for me (note "char" instead of "char1").

If it's not picking up people that only have letters in their name for you then please provide your configuration ("Export" -> "Configuration" in the menu) and I will test with that too. Please also provide the log that you're testing against if possible (you can e.g. PM it if you don't want it public).

Back to top

Bat



Joined: 08 Aug 2007
Posts: 4

PostPosted: Thu Aug 09, 2007 12:44 pm    Post subject:

Reply with quote


Thanks for the response.

Seems to pick it up now. Isn't \w supposed to pick up any alphanumerical character [a-zA-Z0-9_] ?

edit : typo in the config file. Solved now.

Back to top

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Thu Aug 09, 2007 9:11 pm    Post subject:

Reply with quote


Bat wrote:
Seems to pick it up now. Isn't \w supposed to pick up any alphanumerical character [a-zA-Z0-9_] ?


You're right, I always thought that it only picked up [a-zA-Z].

Back to top

Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Patterns All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
SoftGreen 1.1 phpBB theme © DaTutorials.com 2005