how to retrieve the word between 2 specific words with shell script

Hi,

I have a file content like:

:
:
<span class="ColorRed"> 1.23</span><br>
:
:

the value 1.23 will be changed from time to time, and I want to use a shell script command, e.g grep or sed, to retrieve only the value, how to do it?

Thanks!
Victor

Try...

sed 's/[^0-9|.]//g' infile

Hi,

Thanks a lot...

Can I have a further question, how to do that if the content looks like:

:
:
<span class="ColorRed"><img src="http://www.unix.com/../common/images/arrow_red_L.gif" width="26" height="26"> 1.23</span><br>
:
:

Victor

It would be better if you showed more contents from your inputfile...
but check this now...

sed 's/.*\>\( [0-9|.]*\)\<.*/\1/g' infile

generic, to remove '<>' tags

sed 's/<[^>]*>//g'

I don't think that's the requirement...

sed 's/.*\>\( [0-9|.]*\)\<.*/\1/g' infile

Hi,

Thank you all, it works!

Victor