I have a file like:
number_of_x 100 # total number of x
number_of_y 2000 # total number of y
total_rate 1.67 # rate
blah1 0.876 # blah1
blah2 10450 # blah2
I would like to extract numbers related to, say, number_of_y
and total_rate
, for example, output here is:
2000
1.67
This is the closest I can get:
grep -E 'number_of_y|total_rate' my_file | grep -Eo '[0-9.]*'