I need to search multiple strings in a html file and then exclude the searched portion of that string and save rest of the portion to a file.
My file is like
<td colspan="2" class="suite-unknown">
<td colspan="2" class="suite-fail">
<span style="margin: 2px; padding: 1px"> </span>TCS-209
<span style="margin: 2px; padding: 1px"> </span>[TC-001] User validates login
<td colspan="2" class="suite-unknown">
<td colspan="2" class="suite-pass">
<span style="margin: 2px; padding: 1px"> </span>TCS-210
<span style="margin: 2px; padding: 1px"> </span>[TC-002] user close browser
I tried many options : Failed options :
sed -n ('/<span style="margin: 2px; padding: 1px/p'|'/td colspan="2" class="suite-/p') report.html
Another one :
sed -n '/\/<span style="margin: 2px; padding: 1px\|*td colspan="2" class="suite/p' report.html
My keywords for search are : <span style="margin: 2px; padding: 1px and td colspan="2" class="suite.
And then once its searched i need to exclude the search keywords of the string and print the rest.
Means output be like :
-unknown
-fail
TCS-209
[TC-001] User validates login
unknown
pass
TCS-210
[TC-002] user close browser
Please help