You can use /filter with an alias to do this quite quickly:
on *:text:!find *:#:{
;; Filter all matching lines to the alias
filter -fkn quote.txt fquote $+(*,$2-,*)
;; Output results, $filtered contains number of matching lines
if (!$filtered) msg # No quotes found matching $+(*,$2-,*)
else msg # $filtered quote $+ $iif($filtered != 1,s) matching $+(*,$2-,*) found on line $+ $iif($filtered != 1,s:,:) %temp.fquote
unset %temp.fquote
}
;; Add the line number of a found quote to a temporary global variable
alias -l fquote { %temp.fquote = %temp.fquote $+([,$gettok($1,1,32),]) }
Edit: Added if statement
Last edited by Sigh; 18/08/04 04:25 AM.