Search Results

Search: Posts Made By: Chubler_XL
1,463
Posted By Chubler_XL
Be sure to test it with the same number...
Be sure to test it with the same number duplicated several times.

{
for (i=1; i<=NF; i++) {
if($i=="0" || $i+0 != 0) {
array[$i+0]++
if ($i+0 > max)...
1,463
Posted By Chubler_XL
Populating A[] and calculate count and average: ...
Populating A[] and calculate count and average:

{
$1=$1
for (i=1; i<=NF; i++) {
if($i=="0" || $i+0 != 0) {
A[++count]=$i+0
tot+=$i+0
if ($i+0 > max) max=$i+0...
1,463
Posted By Chubler_XL
OK this should work for negative and decimal...
OK this should work for negative and decimal numbers:

{
$1=$1
for (i=1; i<=NF; i++) {
if($i=="0" || $i+0 != 0) {
if ($i+0 > max) max=$i+0
if($i+0 < min || !min)...
1,463
Posted By Chubler_XL
Try this: { ...
Try this:

{
gsub(/[^[:space:]]*[^[:digit:][:space:]][^[:space:]]*/,x,$0)
$1=$1
for (i=1; i<=NF; i++) {
if ($i > max) max=$i
if($i < min || !min) min=$i
}
}
END{
...
Showing results 1 to 4 of 4

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