0. preparation and data files. for example, there is a data file with only one column (you can filter the column with only numbers by various means before ), for example, the operation response time Txt code 490898118923520212149427014651529369235635630272297612780916813551646188581897...
0. preparation and data files
For example, there is a data file with only one column (you can filter the column with only numbers by various means), such as the response time of the operation.
Txt code
490898
1189235
20212
1494270
146515
29369
23563
563027
22976
127809
16813
551646
18858
18977
1. sum
Cat data | awk '{sum + = $1} END {print "Sum =", sum }'
2. average calculation
Cat data | awk '{sum + = $1} END {print "Average =", sum/NR }'
3. calculate the maximum value
Cat data | awk 'In in {max = 0} {if ($1> max) max = $1 fi} END {print "Max =", max }'
4. calculate the minimum value (set an extra large value for the initial value of min)
Awk 'In in {min = 1999999} {if ($1