Reputation: 2414
I have a log file containing html code i need to delete all the content between html tags for every possible match in this file. How is that possible using filters?
Example of my file:
some text here
<html>
code
</html>
some text there
<html>
code
</html>
some other text
The output should be:
some text here
some text there
some other text
Upvotes: 0
Views: 87
Reputation: 195079
why not just:
sed '/<html>/,/<\/html>/d'
it works for your example.
Upvotes: 1
Reputation: 41456
This awk
should do:
awk '/<html>/{f=1;next} !f; /<\/html>/{f=0}' file
some text here
some text there
some other text
Upvotes: 1