I have two text files containing the results of the program execution with similar inputs. and I want to find the difference between these two files when the inputs are equal. Each file may contain the result of 1000 runs, so I need to find a command that first of all check that inputs are same then compare the value of variables. The two programs always have the same number of inputs. However, the numbers of inputs are changeable from a different set of programs which means I have a 50 main program and each one contains two programs that I want to compare. e.g.
//file1.txt
//This is starting at the first line of file1
value in dict:
c: -5493.000000
b: -5493.000000
a: 0.000000
inp_y2: -5493.000000
inp_x2: 0.000000
inp_y1: 0.000000
inp_x1: 0.000000
inp_n: 0.000000
value in dict:
b: -541060888.000000
a: -2147479552.000000
inp_y2: 1571.000000
inp_x2: 541065601.000000
inp_y1: 0.000000
inp_x1: -2147479552.000000
inp_n: 1571.000000
//file2.txt
//This section starts at line 1050
value in dict:
b: -5493.000000
a: 1.000000
inp_y2: -5493.000000
inp_x2: 0.000000
inp_y1: 0.000000
inp_x1: 0.000000
inp_n: 0.000000
value in dict:
b: -541060888.000000
a: -2147479552.000000
inp_y2: 1571.000000
inp_x2: 541065601.000000
inp_y1: 0.000000
inp_x1: -2147479552.000000
inp_n: 1571.000000
So what I expect is to print: the set of inputs and the value of variables that are changed
inp_y2: -5493.000000
inp_x2: 0.000000
inp_y1: 0.000000
inp_x1: 0.000000
inp_n: 0.000000
a=0.000000, a=1.000000
I am happy to have any solution either bash or in python by using for example numpy. Note: this is the only the result of one run, where in one file I may have 1000 "value in dict:" which represents the beginning of each run.