Search Results

Search: Posts Made By: andreaalex
2,253
Posted By Don Cragun
OK. Try: awk ' ($1, $2) in seen {next} { ...
OK. Try:
awk '
($1, $2) in seen {next}
{ c[$1] += ($3 <= 10)
c[$2] += ($3 <= 10)
seen[$1, $2]
}
END { for(i in c) print i, c[i]}' file
1,346
Posted By in2nix4life
cat file 57 7 23 8 14 17 23 1 ...
cat file

57 7
23 8
14 17
23 1

awk '{sum+=$2} END {printf("sum of $2 = %d\ntotal numbers = %d\nmean = %.2f\n", sum, NR, sum/NR)}' file

sum of $2 = 33
total numbers = 4
mean = 8.25
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 01:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy