mIRC Home    About    Download    Register    News    Help

Print Thread
#187188 01/10/07 03:48 AM
Joined: Sep 2006
Posts: 43
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Sep 2006
Posts: 43
I have a script that will search my logs for what i input then output them to a file problem is it also puts a number and a space in front of the line how can i stop the number and space from being added.

here is an example
real log
[Sun, Sep/30/2007 @ 5:10:05 PM -0800 GMT] <NEWMAPSBOT> Player SEGA joined the game
[Sun, Sep/30/2007 @ 5:10:16 PM -0800 GMT] <NEWMAPSBOT> Host: SEGA is not ranked yet.

log search
15126 [Sun, Sep/30/2007 @ 5:10:05 PM -0800 GMT] <NEWMAPSBOT> Player SEGA joined the game
15127 [Sun, Sep/30/2007 @ 5:10:16 PM -0800 GMT] <NEWMAPSBOT> Host: SEGA is not ranked yet

here is the script
Code:

alias logsearch {
  if (!$2) { echo -a Insufficient parameters. Syntax: /logsearch matchword filename(without .txt) }
  else {
    var %matchword = $1, %lognum = $findfile($logdir,*.*,0)
    echo -ga Looking up %lognum logfiles for $qt($1) ....
    window -h @logfilter
    window -h @logbuffer
    noop $findfile($logdir,*.*,0,logfilter $shortfn($1-) %matchword)
    window -c @logbuffer
    if ($line(@logfilter,1)) {
      if (!$isdir($qt($+($mircdir,logsearch)))) { mkdir $qt($+($mircdir,logsearch))) }
      filter -wfc @logfilter $qt($+($mircdir,logsearch\,$2,.txt))
      run $qt($+($mircdir,logsearch\,$2,.txt))
    }
    else { echo -ga Sorry, found no matches of $qt(%matchword) in your %lognum logfiles. }
    window -c @logfilter
  }
}

alias -l logfilter {
  filter -fwn $1 @logbuffer $+(*,$2 ,*)
  if ($filtered) {
    aline @logfilter $str(-,20) File $longfn($1) : $v1 $iif(($v1 == 1),match,matches) of $qt($2) $+ : $str(-,20)
    filter -ww @logbuffer @logfilter
    aline @logfilter $chr(9)
    clear @logbuffer
  }
}



Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Change:
Code:
alias -l logfilter {
  filter -fwn $1 @logbuffer $+(*,$2 ,*)


to:

Code:
alias -l logfilter {
  filter -fw $1 @logbuffer $+(*,$2 ,*)


All we're doing here is removing the "-n" switch from /filter.

Joined: Sep 2006
Posts: 43
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Sep 2006
Posts: 43
Thank you


Link Copied to Clipboard