I have 500 files with name fort.1, fort.2 ... fort.500. Each file contains 800 data as below:
1 0.485
2 0.028
3 0.100
4 0.979
5 0.338
6 0.891
7 0.415
8 0.368
9 0.245
10 0.489
I want to get the average of each line of second column from every file. In other words, get average of second column first line from all files and store in "output.file". Then get average of second column of second line and store in the same "output.file".
I tried with paste command but fail to get what I want.
IS there any way to do in AWK?
Appreciate any help.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…