Answer by perreal for calculating the mean of columns in text files
With some help from grep:grep '[0-9]' folder[12]/* | awk ' { split($0,b,":"); f=b[1]; split(f,c,"/"); d=c[1]; f=c[2]; s[f][d]+=$2; n[f][d]++; nn[d]++;} END{ for (f in s) { printf("%-10s", f); for (d in...
View ArticleAnswer by Jonathan Leffler for calculating the mean of columns in text files
I'd do it with two awk scripts. (Originally, I had a sort phase in the middle, but that isn't actually necessary. However, I think that two scripts is probably easier than trying to combine them into...
View Articlecalculating the mean of columns in text files
I have two folders named f1 and f2. These folders contain 300 text files with 2 columns.The content of files are shown below.I would like to calculate the mean of second column.file names are same in...
View Article
More Pages to Explore .....