title: sed to insert on first match only
body: <p>UPDATED:</p>
  
  <p>Using sed, how can I insert (NOT SUBSTITUTE) a new line on only the first match of keyword for each file.  </p>
  
  <p>Currently I have the following but this inserts for every line containing Matched Keyword and I want it to only insert the New Inserted Line for only the first match found in the file:</p>
  
  <pre><code>sed -ie '/Matched Keyword/ i\New Inserted Line' *.*
  </code></pre>
  
  <p>For example:</p>
  
  <p>Myfile.txt:</p>
  
  <pre><code>Line 1
  Line 2
  Line 3
  This line contains the Matched Keyword and other stuff
  Line 4
  This line contains the Matched Keyword and other stuff
  Line 6
  </code></pre>
  
  <p>changed to:</p>
  
  <pre><code>Line 1
  Line 2
  Line 3
  New Inserted Line
  This line contains the Matched Keyword and other stuff
  Line 4
  This line contains the Matched Keyword and other stuff
  Line 6
  </code></pre>