I want to do the following calculation using awk: (Element2-Element1)/Element1
Element 1 Position: Column x, Row j
Element 2 Position: Column x, Row i
let x=1, j=2, i=6
Input:
0 2 7 2 3 3 desired Output:
0.5 I dont know how to change FNR inside of the AWK script and opening an awk process just to read each Element and then dividing them by using another awk doesnt feel good.
Thanks in advance!
jbe greater thani?0- should it be skipped, should the remaining lines be reordered?awk?