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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -