title: Using awk to remove lines based on value of 4 columns
body: <p>I have a huge bedfile (millions of lines) and it's like this:</p>
  
  <pre><code>chr10   0   200 E5  E5  E5  E5
  chr10   200 400 E2  E1  E5  E3
  chr10   400 600 E5  E2  E5  E1
  chr10   600 800 E5  E5  E5  E5
  chr10   800 1000    E4  E2  E5  E5
  chr10   1000    1200    E5  E5  E5  E5
  chr10   1200    1400    E5  E5  E6  E3
  ....
  </code></pre>
  
  <p>In this file I simply want to remove all the lines where column 4, 5, 6 and 7 have the value "E5".</p>
  
  <p>So the output of this example should be like this</p>
  
  <pre><code>chr10   200 400 E2  E1  E5  E3
  chr10   400 600 E5  E2  E5  E1
  chr10   800 1000    E4  E2  E5  E5
  chr10   1200    1400    E5  E5  E6  E3
  </code></pre>
  
  <p>It's probably very easy but I haven't been able to figure it out yet. I wrote a perl script using a loop to do this but because of the massive size it apparently crashes after a while. I've been looking around for an awk command to do this but couldn't find one that works.</p>
  
  <p>Does anyone have an idea how to do this easily?</p>
  
  <p>Thanks in advance!</p>