0
I have a series of files with 2(two) lines. The first line contains a whole number (1-100) while the second line contains a decimal number(1.0000-99.9999). I need to get the sum of the first line and the average of the second line, i.e:
awk '{sum += $1} {avg / $2} NEXT {print sum} END {print avg}' *log
Example:
1log
20
4.2
2log
34
1.2
Where the output would look like this:
54
2.7
This is failing for me, possibly because I have some files with null values. – Ken J – 2014-03-31T18:33:59.560