awk排重并将第二行累加比如 1 100 2 200 3 300 2 400 3 500
结果是 1 100 2 600 3 800 使用awk方法为: cat logfile | awk '{counts[$1]+=$2}END{for (x in counts){print x, counts[x]}}'
Powered by: 博客园 Copyright © 2024 jong Powered by .NET 9.0 on Kubernetes