Skip to content
Advertisement

Awk average of column by moving difference of grouping column variable

I have a file that look like this:

JavaScript

File is sorted by column 3. I want the average of 4th column grouped by column 3 every 0.5 unit apart. For example it should output like this:

JavaScript

I can print all positions without average like this:

JavaScript

But I am not able to figure out how to print average of 4th column. It would be great if someone can help me to find solution to this problem. Thanks!

Advertisement

Answer

Something like this, maybe:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement