I have a HTML file momcpy.html
from which I want to extract a specific string after a given string.
File content is like:
<tr><br>
<th height="12" bgcolor="#808080"><label for="<br>
LSCRM:Abhijeet<br>
<br>
MCRM:Bhargav<br>
<br>
TLGAPI:GAURAVAURAV<br>
<br>
MOM:MANIKA"></td><br>
This is present on one of the lines of HTML.
I want to extract Manika
and store it in a variable. So Basically I want to extract whatever string is present after MOM:, It could be dynamic.
I have tried:
file='/home/websphe/tomcat/webapps/MOM/web/momcpy.html'
y=$( awk '$1=="MOM:"{print $2}' $file)
echo "$y"
But that didn't work.