title: awk to print lines not found between two files
body: <p>In the <code>awk</code> below I am trying to print out those lines in <code>file2</code> that are not between <code>$2</code> and <code>$3</code> in <code>file1</code>. I think it's close but currently it is printing out the matches. Basically, the opposite of what it is doing.</p>
  
  <p><strong>awk with current output</strong></p>
  
  <pre><code>awk '
  NR==FNR{for(i=$2;i&lt;=$3;++i) d[$1,i] = $6; next}
  d[$1,$2]{print $0}' file2 file1
  chr1 948953 948956 chr1:948953-948956 . ISG15
  chr1 949363 949858 chr1:949363-949858 . ISG15
  chr19 42373737 42373856 chr19:42373737-42373856 . RPS19
  </code></pre>
  
  <p><strong>file1</strong></p>
  
  <pre><code>chr1 948953 948956 chr1:948953-948956 . ISG15
  chr1 949363 949858 chr1:949363-949858 . ISG15
  chr19 42373737 42373856 chr19:42373737-42373856 . RPS19
  </code></pre>
  
  <p><strong>file2</strong></p>
  
  <pre><code>chr1 948796 949006 chr1:948796-949006 . ISG15
  chr1 949313 949969 chr1:949313-949969 . ISG15
  chr19 42363937 42364409 chr19:42363937-42364409 . RPS19
  chr19 42364286 42364565 chr19:42364286-42364565 . RPS19
  chr19 42373718 42373873 chr19:42373718-42373873 . RPS19
  </code></pre>
  
  <p>desired output</p>
  
  <pre><code>chr19 42363937 42364409 chr19:42363937-42364409 . RPS19
  chr19 42364286 42364565 chr19:42364286-42364565 . RPS19
  </code></pre>
  
  <p>description</p>
  
  <pre><code>line 1,2, and 5 match or fall into the range of `file1` and don't need to be printed.
  </code></pre>
  
  <p>To get the output desired I tried and it did execute with no results:</p>
  
  <p><strong>awk</strong></p>
  
  <pre><code>awk '
  NR==FNR{for(i=$2;i&lt;=$3;++i) d[$1,i] = $6; next}
  !d[$1,$2]{print $0}' file2 file1
  </code></pre>
  
  <p>Thank you :).</p>