CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Extract mean in bash (https://www.cfd-online.com/Forums/openfoam-programming-development/244326-extract-mean-bash.html)

Thomthom August 2, 2022 15:40

Extract mean in bash
 
[QUOTE=Thomthom;832962]


Hello !!
I need some help https://www.nixcraft.com/images/emoj...nsive.png?v=12 I have tow lists
file1.txt

1 -30.133 Orange
1 -6.576 Banana
1 -6.293 Apple
1 -12.034 Apricot
1 -7.076 Blackberry
2 -4.355 Apple
2 -6.517 Banana
2 -6.355 Apricot
2 -3.502 Blackberry

and I have the means
file2.txt

1 -12.4224
2 -5.18225


For the groups, I would like to write : For the group 1, Apricot is the most near of the means and for the group 2, Apple is the most near of the means.


All times are GMT -4. The time now is 02:08.