I have a very basic question. I have the following text file (cdrag.txt) and I want to extract only the value (number) that is just after
forceCoeffs forceCoeffs execute: Coefficients Cm : -3.99664 (pressure: -4.01246 viscous: 0.01582) Cd : 2.13648 (pressure: 2.13673 viscous: -0.000249648) Cl : 1.18858 (pressure: 1.18672 viscous: 0.00185425) Cl(f) : -3.40235 Cl(r) : 4.59093
I tried with the command:
cat cdrag | grep "Cd : " | cut -d':' -f2
But this command shows me on the screen "2.13648 (pressure"), that is, what is between the two points, and not just the value 2.13648, which is my goal.
Note: this numerical value is not always the same
Any idea how I could do it? Thank you very much!