I have the next question, I’ll like to have TWO minimun values, a maximun value and the average for this input:
Call 1 1.160 ms
Call 2 0.163 ms
Call 3 1.154 ms
Call 4 1.029 ms
Call 5 0.291 ms
Call 6 1.186 ms
Call 7 1.089 ms
Call 8 1.122 ms
Call 9 0.975 ms
Call 10 1.224 ms
Call 11 0.965 ms
Call 12 1.047 ms
Call 13 1.138 ms
Call 14 1.217 ms
Call 15 1.189 ms
Call 16 1.115 ms
Call 17 0.950 ms
Call 18 1.112 ms
Call 19 1.227 ms
Call 20 1.071 ms
Call 21 1.108 ms
Call 22 1.191 ms
Call 23 1.139 ms
Call 24 1.032 ms
Call 25 1.305 ms
Call 26 1.085 ms
Call 27 1.404 ms
Call 28 1.282 ms
Call 29 1.031 ms
Call 30 1.018 ms
Call 31 1.308 ms
Call 32 1.299 ms
Call 33 1.096 ms
Call 34 1.129 ms
Call 35 1.271 ms
Call 36 1.035 ms
Call 37 1.238 ms
Call 38 1.150 ms
Call 39 1.042 ms
Call 40 0.948 ms
I’ve been using those commands:
awk 'min=="" || $3 < min {min=$3; minline=$0}; END{ print minline}'
awk '{ if ($3>max) {max=$3; line=$0} } END {print line }'
awk '{s+=$3} END{print "Number of Calls: "NR, "\nAverage: "s/(NR)}'
The output is this:
Minimun: Call 18 0.212 ms
Maximun: Call 27 1.404 ms
Number of Calls: 40
Average: 1.1071
But I need to have 2 minimun values, one of them is showed above but the other one should be any number greather than 0.800. I’ve trying this:
awk 'min=="0.800" || $3 < min {min=$3; minline=$0}; END{ print minline}'
But it shows me nothing. Please, I need your help to place this in a script.
Thank you in advance for your help
output:
Note: for the “any number greater than 0.800”, i just checked the Max, if it >0.800,print it as the magic number. if not, print None.
EDIT
changes for OP’s comment:
output: