Reputation:
Shell, bash : grep the html tag in multiple lines
How do I grep from tr to /td in input.txt?
<tr> <td>Answer</td>
My code is
grep -o "<tr>.*</td>" input.txt > output.txt
But it returns nothing..
Upvotes: 1
Views: 1599
Reputation: 23364
You'd be better off using a HTML parser, but for simple needs a range-based awk solution may work
awk '/<tr>/,/<\/td\>/' input.txt