I\'m using awk to deal with a simple .dat file, which contains several lines of data and each line has 4 columns separated by a single space. I want to fin
Awk guesses the type.
String "10" is less than string "4" because character "1" comes before "4". Force a type conversation, using addition of zero:
min=`awk 'BEGIN{a=1000}{if ($1<0+a) a=$1} END{print a}' mydata.dat` max=`awk 'BEGIN{a= 0}{if ($1>0+a) a=$1} END{print a}' mydata.dat`