C
C3
I am trying to write a program that reads multiple files and prints out the
number of occurrences of n-length byte sequences across these files. the
value of n must be specified on the command-line.
Since I'll be dealing with binary files, I want the ASCII codes of the
characters printed out.
e.g. for n=2 and the following 3 files, contents shown as integers,
f1 = {33, 84, 55}, f2 = {84, 55, 12}, f3 = {33, 84, 55}
I want output like this:
3 84 55
2 33 84
I'll be dealing with files up to about one megabyte in size. Efficiency is
not critical, and it does not matter, say, if a length-2 sequence is a
substring of a length-3, or a more frequently occurring sequence. Values of
n will not go above 10.
number of occurrences of n-length byte sequences across these files. the
value of n must be specified on the command-line.
Since I'll be dealing with binary files, I want the ASCII codes of the
characters printed out.
e.g. for n=2 and the following 3 files, contents shown as integers,
f1 = {33, 84, 55}, f2 = {84, 55, 12}, f3 = {33, 84, 55}
I want output like this:
3 84 55
2 33 84
I'll be dealing with files up to about one megabyte in size. Efficiency is
not critical, and it does not matter, say, if a length-2 sequence is a
substring of a length-3, or a more frequently occurring sequence. Values of
n will not go above 10.