|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.|
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;
01 03 02 05 07 04 09 0B 06 ....
how would i do this or does this routine exist already somewhere.
Thaks a lot