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,
total_rate, for example, output here is:
This is the closest I can get:
grep -E 'number_of_y|total_rate' my_file | grep -Eo '[0-9.]*'