I got some binary files containing integers. Is there some nice Unix command, that will allow me to dump it to a terminal without offset information, etc.?
Something like:
double int[4];
while (fread(tmp, sizeof(int), 4, stdin))
for(int i = 0; i < 4; i++)
printf("%d\t",tmp[i]);
It seems that hexdump and od gives me the information I want, but the output is too verbose. I just want the contents.
To solve this kind of problem using standard Unix tools, you typically pipe a bunch together:
The
odprints every 32-bit word in decimal, with preceding offsets. Theawkcomment removes the offsets. Thefmtcommand forces one integer per line. Thesedcommand strips leading spaces off the result.