title: Create HTML table using AWK/SED command on unix
body: <p>I have a file that looks like this. Is there any way I could format the file to how I want it to look like ? ( see below ) I used various verisons of sed/awk but it seems to not work. The purpose of this is so I can get nice tables on my file so when i send them using the mail command on unix it would print out a table by reading the html text. Thank you very much in advance for any pointers or direct help on how to do this !</p>
  
  <pre><code>File
      Candy Max Capacity
      Skittle 2293 1.72
      M&amp;m 3420 2.57
      choco 294 .22
      sugar  246 .18
      Salt Max Capacity
      one 2293 1.72
      two 3420 2.57
      three 294 .22
      four   246 .18
      Candy Max Capacity
      Skittle 2293 1.72
      M&amp;m 3420 2.57
      choco 294 .22
      sugar  246 .18
      TONS OF WORDS AND INFO HERE. TONS OF WORDS AND INFO HERE. 
      TONS OF WORDS AND INFO HERE. TONS OF WORDS AND INFO HERE. 
      TONS OF WORDS AND INFO HERE. TONS OF WORDS AND INFO HERE. 
      TONS OF WORDS AND INFO HERE. TONS OF WORDS AND INFO HERE. 
      TONS OF WORDS AND INFO HERE. TONS OF WORDS AND INFO HERE. 
      TONS OF WORDS AND INFO HERE. TONS OF WORDS AND INFO HERE. 
  </code></pre>
  
  <p>Example of how I want it to look like.</p>
  
  <pre><code>MIME-Version: 1.0
  Content-Type: text/html
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;table border="1" style="width:300px"&gt;
  &lt;tr&gt;
  &lt;td&gt;Candy&lt;/td&gt;&lt;td&gt;Update&lt;/td&gt;&lt;td&gt;Capacityt&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;SKittle&lt;/td&gt;&lt;td&gt;2293&lt;/td&gt;&lt;td&gt;1.72&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;M&amp;M&lt;/td&gt;&lt;td&gt;3420&lt;/td&gt;&lt;td&gt;2.57&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Choco&lt;/td&gt;&lt;td&gt;&lt;/td&gt; 294&lt;td&gt;.22&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Sugar&lt;/td&gt;&lt;td&gt;&lt;/td&gt; 246&lt;td&gt;.18&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/html&gt;
  </code></pre>