Usually, the third row is not being printed when I use the above command. But, I would like to know a way to still print the third row on a condition that if 5th column or 6th column is zero, I don't want the command to calculate the log2(), instead print just 0.
Your code doesn't work at all. Your input has no column 13.
Splitting it into three awks like that has made it really hard to tell which terms you're using for what. I cannot make a program that generates the exact numbers you want; your original does not work at all for me, even for the valid ones, and the one I made generates very different numbers from what you want.
Perhaps if you explained what you did want, instead of asking me to reverse engineer a broken program which doesn't do what you want?
Thanks Corona688. You were right. My input was incorrect. Sorry for it. But, your code did work. I would also like to include the condition that if $6 is zero, do the same.