Find the numeric value in a string and then check the max. value

hi,

i have a string
"[10/2/08 6:19:55:834 EDT] 00000069 ThreadMonitor W WSVR0606W: Thread "WebContainer : 43|null" (00000069) was previously rep
orted to be hung but has completed. It was active for approximately 47533430 milliseconds. There is/are 43 thread(s) in tot
al in the server that still may be hung."

and i want to find "There is/are 43", i am using the following command for this:

grep 'There is/are' hung.txt | cut -c219-234

there may have multiple values for the above string, so i need to check the max number out of this string. my initial approach is:

grep 'There is/are' hung.txt | cut -c230-234 | tr -dc '[0-9]'

i am only cutting the numeric values but all the values are printing into a single line. plz help me with this or if there is another way to do this????

thanks in advance

Try sth like this...

awk -F "is/are" '{split($2,P," ");a=a>P[1]?a:P[1]}END{print a}' file
bash-3.2$ awk -F "is/are" '{split($2,P," ");a=a>P[1]?a:P[1]}END{print a}' hung.txt
awk: syntax error near line 1
awk: bailing out near line 1

i tried this but it is giving above error..

Use /usr/xpg4/bin/awk or nawk on Solaris.

here is what i did for the above issue:

grep 'There is/are' hung.txt | cut -c231-233 | grep '[0-9]'|sed 's/^[ \t]*//;s/[ \t]*$//'>max.txt

first i tried to cut the numberic part of a string value and then store it into the text file and then to get the max value i tried following command and its working now..

awk '$0>x{x=$0};END{print x}' max.txt