I have 3 files:
File_1 is static, the content is not changing, vales can be -160 to 0:
xdslcmd: ADSL driver and PHY status
Status: Idle
Retrain Reason: 0
Tone number QLN
0 0.0000
1 0.0000
2 0.0000
3 0.0000
4 0.0000
5 0.0000
6 0.0000
7 -160.0000
8 -119.2000
9 -128.6700
10 -113.1200
11 -93.1000
12 -130.0000
13 -120.0000
14 -110.0000
15 -100.0000
16 -90.0000
17 -100.0000
18 -110.0000
19 -120.0000
20 -130.0000
21 -140.0000
22 -110.0000
23 0.0000
24 0.0000
File_2 is looks like File_1 but the values are changing every time (values can be -160 to 0)
xdslcmd: ADSL driver and PHY status
Status: Idle
Retrain Reason: 0
Tone number QLN
0 0.0000
1 0.0000
2 0.0000
3 0.0000
4 0.0000
5 0.0000
6 0.0000
7 -160.0000
8 -159.2000
9 -148.6700
10 -123.1200
11 -83.1000
12 -100.0000
13 -100.0000
14 -100.0000
15 -80.0000
16 -80.0000
17 -110.0000
18 -120.0000
19 -130.0000
20 -140.0000
21 -150.0000
22 -100.0000
23 0.0000
24 0.0000
I want to compare File_2 $2 to File_1 $2 and store the difference between them inf File_3
Exmaple:
File_1 contains: 18 -120.0000
File_2 contains: 18 -140.0000
Expected output: 18 -20 0
File_1 contains the base values (considered as "0")
File_2 changes every time and holds the actual values.
The expected output is the min/max difference from the base values during the measurement.
It is possible that in the same tone QLN can be higher and lower during the measurement:
File_1 contains: 18 -120.0000
File_2 contains: 18 -140.0000
File_2 contains: 18 -100.0000 (in a later query)
Expected output: 18 -20 +20
File_1 and File_2 are sorted, the first 5 lines are not relevant.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…