Hi i have a file like this (with n-lines):
0.001 5.4e+08
0.03 0.08
0.5774 0.1
93 9832
now i want to read the maximum value of each column. i tried awk like this:
awk -v "max=0.2" -v "index=1" 'BEGIN{if (index>max) max=index} END {print max}' file
and asign the output to a variable. Only typing the awk command in the shell gives me this error:
awk: run time error: cannot command line assign to index
type clash or keyword
FILENAME="" FNR=0 NR=0
The Problem is that the file has n-lines and i am only looping over certain lines. How can i give awk the line to work on and read out the maximum value of the column of that line?