title: Using sed to replace multiple lines in multiple files
body: <p>I have thousands of html files in which there are two different pieces of  old google adsense code which needs to be replaced by new ones. The files are on a linux server.</p>
  
  <p>the old code looks like:</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;&lt;!--
  google_ad_client = "pub-xxx";
  google_ad_width = 336;
  google_ad_height = 280;
  google_ad_format = "336x280_as";
  google_ad_type = "text";
  //2007-06-09: Forum archive rectangle
  google_ad_channel = "1013717472xx";
  google_color_border = "FFFFFF";
  google_color_bg = "FFFFFF";
  google_color_link = "0000FF";
  google_color_text = "000000";
  google_color_url = "000000";
  //--&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I need to match this text "google_ad_channel = "1013717472xx"" within the code, replace the whole code with new one.  </p>
  
  <p>the new code is as follows:</p>
  
  <pre><code>&lt;script src="https://pagead2.googlesyndication.com/pub-config/r20160913/ca-pub-xxx.js"&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pub-config/r20160913/ca-pub-xxx.js"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;&lt;!--
  google_ad_client = "pub-xxx";
  /* frm arch linkunit 200x90, created 5/30/08 */
  google_ad_slot = "0112084554";
  google_ad_width = 200;
  google_ad_height = 90;
  //--&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I use sed to do the replacement in all the html files on my server?</p>
  
  <p>Thank you in advance!</p>