当前位置:网站首页>Awk statistical average max min
Awk statistical average max min
2022-07-21 00:08:00 【Hong Dayu】
#!/bin/awk -f
BEGIN {
min=0
max=0
diff=0
avg=0
sum=0
cnt=0
}
{
# cals diff find max min avg
diff=$6-$4
sum=sum+diff
cnt=cnt+1
if(NR == 1){
min = diff
max = diff
}
if(min > diff){
min = diff
}
if(max < diff){
max = diff
}
}
END {
avg=sum/cnt
printf("min: "min" max: "max" avg: "avg" cnt: "cnt"\n")
}
边栏推荐
- 根据子节点递归获取所有父节点集合
- IDEA版Postman面世了,功能真心强大
- Transform streams into data products
- 没有了可用Task slot,Flink新增任务会怎样?
- .NET 设置Socket 对象的“TFO”快速打开连接选项(跨平台兼容的)
- 葡萄牙语金融财务词汇翻译
- When byte hung up, the interviewer asked DDD, but I didn't know
- NFT in the eyes of blackash: the platform is crying for slaughter, and users send money to the door
- Bi analytical thinking of business intelligence: Capital Management in manufacturing industry
- 关于 SAP UI5 对服务器端渲染 Server Sider Render 的支持问题
猜你喜欢
随机推荐
nextTick那些事儿
My creation anniversary
Matlab | time series short-term traffic flow prediction based on Wavelet Neural Network
[e-commerce operation] try these five personalized marketing methods to bid farewell to ineffective marketing!
CF 809div2 DE
Golang - restful framework go restful
Kubernetes — client-go组件
C语言基础演练(6)
COLA 4.0 - DDD项目实践
Goodbye VLAN, I choose to use QinQ! 1000 words will bring you a detailed understanding of QinQ technology
接口自动化测试---单接口自动化测试与业务场景自动化测试之间的区别?
Zero Path
RS485 Serial Communications¶
洛谷P1955 程序自动分析
支付宝 alipay.fund.trans.uni.transfer(单笔转账接口)功能整合
App application testing methods and testing ideas
Bubble sort
3.JS基础
CF 809div2 DE
Circle Game