I want to extract the next word/number after specific words I find using grep or whatnot.
As an example lets say this is what I have in stdout
string-a0 match-a1 string-a2 string-a3
string-b0 string-b1 match-b2 string-b3
match-c0 string-c1 string-c2 string-c3
I want to be left with just this
string-a2
string-b3
string-c1
mind that match-a1 != match-b2 != match-c0
EDIT
A concrete example...
stdout is this
open 0.23 date ...
close 1.52 date ...
open 2.34 date ...
close 5.92 date ...
open 10.78 date ...
close 24.21 date ...
total 45.3
I'm searching for the words open
, close
and total
so the output should be
0.23
1.52
2.34
5.92
10.78
24.21
45.3