there is a typo on a line:

Code:
if ($left($read(filter.txt,n,%x),1) == @) || ($v1 == +) { %inc x }


should be:

Code:
if ($left($read(filter.txt,n,%x),1) == @) || ($v1 == +) { inc %x }


If it ain't broken, don't fix it!