Hello again,
sorry for this repeated post, but I need some help.
I have the following lines:
2 2 2 1 1
1 2 5 1 1
1 2 2
1 17 2 1 2 3 2 3
How can I print out the maximum value of a line?
I have tried this, but cannot helps me at the moment
awk '{for(i=1;i<=NF;i++){if($i > max) max = $i;}}END{print max}' < the/file/
but prints only 17
sorry for this repeated post, but I need some help.
I have the following lines:
2 2 2 1 1
1 2 5 1 1
1 2 2
1 17 2 1 2 3 2 3
How can I print out the maximum value of a line?
I have tried this, but cannot helps me at the moment
awk '{for(i=1;i<=NF;i++){if($i > max) max = $i;}}END{print max}' < the/file/
but prints only 17