I have a text file containing both text and numbers, I want to use grep to extract only the numbers that I need, for example, for a file:
miss rate 0.21
ipc 222
stalls n shdmem 112
So say that I only want to extract data for miss ratewhich 0.21. How to do it with grep or sed? In addition, I need more than one number, not just after miss rate. That is, I might want to get both 0.21, and so 112. An example output might look like this:
0.21 222 112
Because I need data for the next chart.
source
share