I have a file which contain two columns, eg
abc.txt
000000008b8c5200 af dg sd jh g1 43 66 23 67
000000008b8c5220 bc bi ub cb ue qi hd 16 72
0000000056fb2620 ad ag sj ha bn bc bh 53 69
0000000056fb2640 ak bh jg bf re 34 16 8g ff
0000000045ab4630 sg fj g3 6g dh w7 28 g7 dg
0000000045ab4650 jb sh jd b7 us vy ys du 89
Here I need to concatenate 2nd row 2nd column with first row first column like this:
bcbiubcbueqihd1672afdgsdjhg143662367
Condition for concatenating:
only when (hexadecimal)difference between 2nd row, 1st column and 1st row, 1st column is 20. For this example it would be:
000000008b8c5220 - 000000008b8c5200 = 20.
0000000056fb2640 - 0000000056fb2620 = 20.
0000000045ab4650 - 0000000045ab4630 = 20.
Similarly for upcoming rows and columns. Write the results to a file with first row and concatenated data like this:
000000008b8c5200 bcbiubcbueqihd1672afdgsdjhg143662367
0000000056fb2620 akbhjgbfre34168gffadagsjhabnbcbh5369
0000000045ab4630 jbshjdb7usvyysdu89sgfjg36gdhw728g7dg
How can I do this?