How to iteratively divide the elements of a column by a one-element item in another column?Eg, Input: 2     22.2444Expected Output:11.1222Standard division awk '{print $1/$2}' Input > Output is not working (as iterating through all non-exixting $2 elements)
Divide items of a column by one-item column
text processing;awk;arithmetic
To get the divisor you need to consider the value at the first row of the second column only. You can use FNR for this. In awk, FNR refers to the record number (practically the line number) in the current file. Store the divisor by reading the first row of second column and divide the elements in first column by the stored value.  awk 'FNR==1 {d=$2} {print $1/d}' Input > Output 