-
Algorithm for join rows
I have file with Strings those with fixed size, with 14
numbers
Which can be:
4
2
1
1 is as bit 001
2 is as bit 010
4 is like bit 100
Example of a file:
44444444444444
24444444444441
12444444444441
14444444444442
44244444444441
44144444444441
44444444444441
..
Should I build a way algorithm read all the lines of this file
and create another minor, but add the line as follows:
When there are two lines of 1 to two different numbers must try to join these two
lines as follows, for example
44444444444444
24444444444441
Above The two lines differ only by first and last columns
I have to make a XOR in their respective columns that saw only one line
4 xor 2 ==> 6
4 xor 1 ==> 5
64444444444445
Some time I have 3 lines like
44444444444444
24444444444441
14444444444441
two differences that would turn
74444444444445
I would like someone that an idea of how to implement this Reading a file and generating another