If you really want a binary representation of the data, you could do it like this:
perl -ne 'printf "0x%04x %s\n", $o++, unpack("B*", $c) while $c = substr($_, 0, 1, "");') while length;' datafile The output will look a little like this:
0x0000 00000001 0x0001 00000010 0x0002 00110011 0x0003 00110100 0x0004 00001010 If that's not what you want, please be a little more specific about what you're expecting.