I got a file that contains i.e:
Diameter is defined by... diameter 26.5/9 diameter has been changed
diameter has changed and then DIAMETER 942/10 yada di yada Diameter
In output i want:
26.5/9
942/10
As far as I understand:
I need to search for case insensitive string "diameter" that is followed by space and numeric character than go back to "diameter" and print following string between spaces.
I've only managed to came up with something like this:
sed -n '/^.*diameter\s\+\(\w\+\).*$/s//\1/p'
but it only prints single word (separated by non-alphanumeric) following a first occurence of case sensitive word "diameter". Output would look like this:
26
has