merge 2 binary into 1

January 10, 2012 at 08:23:25
Specs: Linux x86_64
Ii want to merge two binary files. I would like to alternate between file 1 and file 2 taking x bits of data from File 1 and y bits from File2 and writing the results to file 3. and repeating the alternating and writing to file 3 until end of file. If possible it schould count haow many alternation there were and write it in the end or beginning of the file.

for example:

file1 data x=2
01 03 05 07 09 0B 01 03 05 07 09 0B

file 2 data y=1

02 04 06 08 0A FF
after alternating back and forth between file1 and file2 and writing to file3 and repeating till no more data is left in file1 and file2.
output should look like this;

file3 data
01 03 02 05 07 04 09 0B 06 ....

how would i do this or does this routine exist already somewhere.

Thaks a lot


See More: merge 2 binary into 1

Report •

#1
January 11, 2012 at 20:53:11
Write a shell script and use the `dd' command

Report •

#2
January 12, 2012 at 03:30:51

thanks

Report •
Related Solutions


Ask Question