Search Results

Search: Posts Made By: rdcwayx
6,647
Posted By rdcwayx
awk -F,...
awk -F, '{a[$1]++;b[$1]+=$2;min[$1]=(min[$1]==""||min[$1]>$2)?$2:min[$1];max[$1]=max[$1]>$2?max[$1]:$2}
END{for (i in a) print i, a[i],b[i]/a[i],min[i],max[i] |"sort -n"}' infile

B0000003 1...
6,647
Posted By rdcwayx
Not fully understand your request. But if you...
Not fully understand your request. But if you just need to calculate the average for each name, try AWK's array, no need to sort the data

awk -F, '{a[$1]++;b[$1]+=$2}END{for (i in a) print i,...
Showing results 1 to 2 of 2

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