title: Sed replace every nth occurrence
body: <p>I am trying to use sed to replace every other occurrence of an html element of a file so I can make alternating color rows.</p>
  
  <p>Here is what I have tried and it doesn't work.</p>
  
  <pre><code>sed 's/&lt;tr valign=top&gt;/&lt;tr valign=top bgcolor='#E0E0E0'&gt;/2' untitled.html
  </code></pre>