【发布时间】:2016-11-28 23:18:20
【问题描述】:
我需要设置一个单行命令来获取文件中一列中大量数字的平均值包含多列,我们需要添加文件名的参数和大文件所需的列数
Example: # avgerage_column 3 test
average_column should be the script
3 is the number of the column in the big file
test is the big file
Sample:
210 56687 1792 18 55 26 1
188 21949 961 9 57 34 0
201 1257 521 1 46 54 0
260 11455 641 4 47 49 0
244 16466 756 7 38 55 0
54 1570 651 1 14 85 0
161 619 583 0 28 72 0
88 479 600 0 26 74 0
30 394 670 0 37 63 0
6 3713 369 3 79 18 0
24 16109 553 16 60 24 0
7 877 482 0 68 32 0
84 845 525 0 63 36 0
31 844 492 0 79 21 0
谢谢
【问题讨论】:
-
你能用
awk这个吗?有很多问题需要寻找。
标签: bash moving-average