I have a static block of text that I need to remove from a file created nightly from concatenating multiple files into one. The text cuts across 6 line as one block and has a bunch of special characters like " , > , and / . I know I should be able to use awk
, sed
, or perl
, but I can't get the escape of the special characters correct, either it errors or does not find the block.
The block is always this on the separate lines:
</channel>
</rss><?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title><![CDATA[Example]]></title>
<description><![CDATA[Example]]></description>
<link><![CDATA[https://www.example.com/]]></link>
I want to change
</item>
</channel>
</rss><?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title><![CDATA[Example]]></title>
<description><![CDATA[Example]]></description>
<link><![CDATA[https://www.example.com/]]></link>
<item>
into
</item>
<item>
it appears 8 times in the file that is created by concatenating multiple streams.