awk - Mathematical operation on columns of two files -
i have file 2 columns. following operation: col1/ [ (1+0.214/(col2*col2))^2 ]. write awk command:
awk '{print $1/(1+.214/($2*$2))*(1+.214/($2*$2))}' ab.txt > g1.txt
but getting same numbers column1 in output. please tell me going wrong?
thank you.
it no surprise same numbers again because there 1 pair of parentheses missing. @ expression! calculate (y/x) * x (y divided x multiplied x). need y/(x*x) or in other words
awk '{print $1/((1+.214/($2*$2))*(1+.214/($2*$2)))}' ab.txt > g1.txt
don't worry! if had gotten penny every missing parenthesis, ...
Comments
Post a Comment