Select rows after the maximum minimum valor found
Input file
22 101 5
23 102 5
24 103 5
25 104 23
26 105 25
27 106 21
28 107 20
29 108 8
30 109 6
31 110 7
To figure out my problem, I tried to subtract column 3 and print the lines after the minimum value found in column 4. In this case after row 7
awk '{$4 = $3 - prev3; prev3 = $3; print $0}' file
22 101 5
23 102 5 0
24 103 5 0
25 104 2 18
26 105 2 2
27 106 2 -4
28 107 2 -1
29 108 8 -12
30 109 6 -2
31 110 7 1
Desired Output
29 108 8
30 109 6
31 110 7
I believe there is better and easy way to get same output.
Thanks in advance
valora typo and do you meanvalue, or is it a specific term (if so, please explain). Do the first and second row have any meaning or use here?+addition but you re writing it subtraction? Also not clear which maximum and minimum values are you talking? column 4 or column3? Please edit your post with correct samples and get back to us then.22 101 5 <newline> 23 102 7for example? Should both rows be printed or just the last one (what is the default value of "0th" row)?