The numbers you have shown are not bytes. Assuming the data looks exactly how you have shown it, then one of these should work for counting the numbers for you.

Code:
alias numcount {
  var %haystack = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
  var %needle = 04 05 06 07 08 09

  %needle = /( $+ $regsubex(%needle,/ /g,$chr(124)) $+ )/g
  var %count = $regex(%haystack,%needle)

  echo -a %count 
}

alias numcountret {
  var %haystack = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
  var %needle = 04 05 06 07 08 09
  var %matches, %count = 0

  var %c = 0, %cc = $numtok(%needle,32)
  while (%c < %cc) {
    inc %c
    if ($count(%haystack,$gettok(%needle,%c,32))) {
      %matches = $addtok(%matches,$gettok(%needle,%c,32),32)
      inc %count $v1
    }
  }

  echo -a %count : %matches
}


The first alias calculates the count only. The second alias calculates the count and retains the matches. You will have to integrate those aliases into your code if you want to read from text files, etc.

-genius_at_work