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
}
}