title: How can I delete all lines before a specific string from a number of files
body: <p>I have n files, like: </p>
  
  <p>file1:</p>
  
  <pre><code>1aaa
  2eee
  
  Test        XXX
  Hanna
  Lars 
  </code></pre>
  
  <p>file2:</p>
  
  <pre><code>1fff
  2ddd
  3zzz
  
  Test        XXX
  Mike
  Charly
  </code></pre>
  
  <p>I want to remove all rows before "Test   XXX" from all n files.
  The number of rows to delete varies between files.</p>
  
  <p>My idea:</p>
  
  <pre><code>for file in 1 :n
  do
  pos=grep -n "Test XXX" file$file
  sed -i "1:$pos-1 d" file$file &gt;new$file
  done
  </code></pre>