I have a huge text file with digits representing an 8 bit value in binary. I want to convert these to hexadecimal (or decimal, doesn't really matter). That is, I have a text file containing e.g.
0 0 0 0 1 1 0 1
0 0 1 1 1 0 0 1
0 1 0 0 0 1 0 1
1 0 0 0 1 1 0 1
(just 8 bits) and I'd want to convert this to, say,
0x0d
0x39
0x45
0x1d
It sounds like this could be done with an awk script/vim macro, or a combination of any other tools.