Quantcast
Channel: calculating the mean of columns in text files - Stack Overflow
Browsing all 3 articles
Browse latest View live

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 Article



Answer 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 Article

calculating 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
Browsing all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>