P
P
Povsekakiy Ivanov2014-08-05 23:45:37
linux
Povsekakiy Ivanov, 2014-08-05 23:45:37

How to remove a line from a file between certain characters?

Hello!!!
There is an html file. It is necessary to remove all tags from it, that is, all the content between the signs "<" and ">". How to do this with grep or sed (or use both tools together)?
Thank you in advance!!!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Lerg, 2014-08-05
@Povsekakij

sed -e 's/<[^>]*>//gm' file.html

V
Valentine, 2014-08-06
@vvpoloskin

Yes, there is only one caveat - in html you can do this:

<a
href="http://google.com"
>
КРУТОЙ ПОИСК
</a>

But you can process this only with a DOM parser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question