How to remove XML tags from Unix command line?

后端 未结 5 1014
再見小時候
再見小時候 2021-01-31 18:43

I am grepping an XML File, which gives me output like this:

data
more data
...

Note, this is a fl

5条回答
  •  有刺的猬
    2021-01-31 19:20

    If your file looks just like that, then sed can help you:

    sed -e 's/<[^>]*>//g' file.xml
    

    Of course you should not use regular expressions for parsing XML because it's hard.

提交回复
热议问题