I have a text file as below
jhasdh jkhsd
lahs dkjh j
<table>
<colgroup>
<col style="width: 100%" />
</colgroup>
<tbody>
<tr class="odd">
<td><p><span class="c2">sample text</span></p>
<p><span class="c2">sample text3</span></p>
</td>
</tr>
</tbody>
</table>
lajslkdjl
;kjksalkd j
;kasdl kj
<table>
<colgroup>
<col style="width: 100%" />
</colgroup>
<tbody>
<tr class="odd">
<td><p><span class="c2">sample text223</span></p>
<p><span class="c2">sample 2332text3</span></p>
</td>
</tr>
</tbody>
</table>
jashdkjh
jashdjkh
jskdhkj
Now i want the entire <table> .mutiple lines her.. </table>
to be in one line. i.e
jhasdh jkhsd
lahs dkjh j
<table><colgroup><col style="width: 100%" /></colgroup><tbody><tr class="odd"><td><p><span class="c2">sample text</span></p><p><span class="c2">sample text3</span></p></td></tr></tbody></table>
lajslkdjl
;kjksalkd j
;kasdl kj
<table><colgroup><col style="width: 100%" /></colgroup><tbody><tr class="odd"><td><p><span class="c2">sample text223</span></p><p><span class="c2">sample 2332text3</span></p></td></tr></tbody></table>
jashdkjh
jashdjkh
jskdhkj
I can do this in sublime text as follows
find: (?s)(<table>(?:(?!<table>).)*?</table>)
then all the <table> ... </table>
are selected
then find \n
and replace with ""
(blank) in the selection
But i want to do it using sed or awk
how can i do it