Search between two words

Hello,

I try to print out with sed or awk the 21.18 between "S3 Temperature" and "GrdC" in a text file.

The blanks are all real blanks no tabs.

Only the two first chars from temperture are required. So the "21" i need as output.

S3 Temperatur 21.18 GrdC No Alarm

Pleas give me a hint.

Thank you very much.

Felix

Let me know if that works!

echo "S3 Temperatur 21.18 GrdC No Alarm" | sed 's/S3 Temp[^0-9]*\([0-9]\{2\}\).*GrdC.*/\1/'
echo "S3 Temperatur 21.18 GrdC No Alarm" | awk '{sub(/\..*/,"",$3);print $3}'

Hello Jacobs,
hello balajesuri,

both awk and sed commands works perferctly.

Thank you very much for your quick posting.

Felix