Q:

How to remove the html tags using sed

Input is:
    
    
    
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>

</body>
</html>

Expected Ouput:
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6

I tried sed -n 's/<[^>].*>//gp' example.html
but get nothing on screen, it seems the regular expression is not right

A:

sed -n 's/<[^>]*>//gp' test.csv | sed '/^$/d'

You are almost there, the dot(.) you used could match a ">" character, so remove it from you command
the command after pipe is to clear all blank lines

