in reply to Re^4: Calculating Row Averages From a CSV File
in thread Calculating Row Averages From a CSV File
This input:
AAA01,0,0,0,0,0,1 AAA02,0,0,0,0,1,1
gives this output:
Row average = 0.166666666666667 Row average = 0.333333333333333
Looks about right to me ;)
Perhaps I should explain the following line:
$_ and $row_sum += $_
This says "If $_ is true (ie non-zero1), add it to $row_sum".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Calculating Row Averages From a CSV File
by rayv (Novice) on Aug 15, 2007 at 14:34 UTC | |
by FunkyMonk (Bishop) on Aug 15, 2007 at 14:49 UTC |