title: update file based on match from another file using awk
body: <p>I am trying to ouput a new file based on a match.  In the <code>input</code> file there are a list of ids that will match <code>$5</code> before the <code>|</code> in file. If the two ids match then the entire line from file is part of the new file. If no match is found then it skips it and moves on. The <code>awk</code> below does run but the resulting <code>new</code> file is empty.  Thank you :).</p>
  
  <p><strong>input</strong></p>
  
  <pre><code>DACH1
  POLE2
  GNG7
  </code></pre>
  
  <p><strong>file</strong></p>
  
  <pre><code>chr13   60737711    60737910    chr13:60737711-60737910 DIAPH3-673|gc=69.3
  chr13   72337884    72338003    chr13:72337884-72338003 DACH1-674|gc=30.3
  chr19   2591538 2591657 chr19:2591538-2591657   GNG7-183|gc=48.7
  </code></pre>
  
  <p><strong>desired output</strong></p>
  
  <pre><code>chr13   72337884    72338003    chr13:72337884-72338003 DACH1-674|gc=30.3
  chr19   2591538 2591657 chr19:2591538-2591657   GNG7-183|gc=48.7
  </code></pre>
  
  <p><strong>awk</strong></p>
  
  <pre><code>awk 'BEGIN {FS=OFS="|"} NR==FNR{a[$1]=$5;next} $5 in a{$5=a[$1];print $0}' input file &gt; new
  </code></pre>