Im supprised this was all that was needed to reduce lines to managable sizes, but if it is it is.

Use this its alot faster.

Code:
alias test2 {
  var %idx = 0, %b, %chr
  write -c txt.txt
  .fopen a page.txt
  while (!feof) {
    if ($ferr || $feof) { .fclose a | return }
    %b = $fread(a,4096,&var)
    if (%b) {
      if (1) {
        while ($bfind(&var, $v1, 9)) {
          bset &var $v1 0
        }
        bwrite txt.txt -1 &var
      }
    }
  }
}


The if (1) { is needed to preload $v1 for the while loop