This code can be used to filter a #channel to a file.txt.

Code:
alias listfilter {
  ;$1 = channel, $2 = filename

  if (!$2) { echo -a /listfilter <channel> <filename> | return }

  if (%lf.busy) { echo -a Already filtering %lf.target | return }
  set %lf.busy 1
  var %lf.start = $ctime
  set %lf.target $1

  if ($window($+(@sort.,$1))) window -c $+(@sort.,$1)
  window -hl $+(@sort.,$1)

  if ($exists($2)) .remove $2
  filter -wlk $1 sfadd *
  filter -wftl 1 32 $+(@sort.,$1) $2 *
  if ($exists($2)) run $$2

  echo -s Channel: $1 Lines: $filtered Time: $calc($ctime - %lf.start) $+ s

  :error
  unset %lf.*
  if ($window($+(@sort.,$1))) window -c $+(@sort.,$1)
  reseterror
}

alias -l sfadd aline $+(@sort.,%lf.target) $regsubex(,$1,/^[ $+ $prefix $+ ]/g,)


Syntax: /listfilter #channel file.txt

The /listfilter alias can only be called once at a time. A variable ensures that the alias is not called again before the first occurance has completed.

I tested it on a channel of 1000+ users, and it took less than 1 seconds to complete.

-genius_at_work