This awk program tests for both queries in one pass
and prints the results.
If your data is delimited by commas or colons, add
a BEGIN statement to the first line thus:
awk 'BEGIN { FS = "," }
awk '
FILENAME == "infile" {
for ( i=1 ; i<= NF ; i++ )
if ( $i >= largest ) largest = $i
}
FILENAME == "infile" {
for ( i=1 ; i<= NF ; i++ )
if ( $i <= lowest ) lowest = $i
} END { print ""
print "Largest number is : "largest
print "Lowest number is : "lowest }' infile infile
# Input test file listed below:
-.12345 1.2345 4.5678 -.003567 9.9876
12.5678 4.3498 7.8934 11.96215 -.2345
02.2543 3.1256 5.1234 -.000147 -.0003
Hope this helps!
flogrr
flogr@yahoo.com