I have a file, output.log, that has a list of space, ' ', separated integers ranging from [-2048,2048]. I am attempting to convert this to a binary file with xxd. I'm using the command,
xxd -r -p output.log > output.bin
However when I read the file back with xxd I lose all of the signs (-) and receive some values greater than 2048. Is there a better way to do this? Thanks.
edit: With sample data...
$ cat test
4 0 -3 -2 -1 200
$ xxd -r -p test > test.bin
$ xxd test.bin
0000000: 4012 00 @..
Maybe I am misunderstanding what xxd is doing, what I expected to see after the last command is to see my original input data being displayed back. Is this not correct?
With much larger data sets I will see the correct values show up from time to time but there is still a ton of noise in the output.