本文介绍了如何汇总在AWK列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的文件由逗号这给64列分隔。我抽取的域,如下所示:

My file is delimited by a comma which gives 64 columns. I extracted the field as shown below:

awk '{split($0,a,",");  print a[57]}'

我如何计算值的57列总和与我的命令?

How can I compute the sum of the values in columns 57 with my command?

推荐答案

您可以总结列57文件,并用它打印

You could sum the column 57 of your file, and print it using

awk '{split($0,a,","); sum += a[57]} END {print sum}' 

这篇关于如何汇总在AWK列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 13:13