Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- E12 E 2 7.75 11.97
- E20 E 4 7.85 8.32
- E17 E 2 7.75 19.25
- A15 A 3 7.85 4.52
- A29 A 2 7.75 14.26
- A14 A 3 7.85 13.29
- C14 C 6 8.05 48.23
- C12 C 6 8.05 29.42
- C42 C 2 7.75 13.42
- awk '
- NR > 2 {TOT[$2,$4] += $5 # sum values into array indexed by both columns'' contents
- CNT[$2,$4]++ # count occurrences
- }
- END {for (t in TOT) {split (t, C, SUBSEP) # split indices into colonies and pH''es
- print C[1], C[2], TOT[t]/CNT[t] # print colony, pH, average
- }
- }
- ' OFS="t" file | sort # define output filed sparator and input file
- A 7.75 14.26
- A 7.85 8.905
- C 7.75 13.42
- C 8.05 38.825
- E 7.75 15.61
- E 7.85 8.32
Add Comment
Please, Sign In to add comment