I have several data files in this format:
orange 25 high
red 23 low
blue 20 low
green 10 high
I would like to divide column 2 by the total number of lines in the file.
I've tried this:
awk '{$2=$2/NR}1'
but the output divides the first row by 1, the second by 2 etc. I want each row divided by the total number of lines in the file.