title: Joining two files based on the first columns and preserving order
body: <p>How can I join two files based on their first columns and preserving the order from the second file.. </p>
  
  <p>File 1:</p>
  
  <pre><code>ID1 123
  ID2 234
  ID3 232
  ID4 344
  ID5 345
  ID6 867
  </code></pre>
  
  <p>File 2</p>
  
  <pre><code>ID2 A C
  ID3 G T
  ID1 C T
  ID4 A C
  ...
  </code></pre>
  
  <p>So the merged file should look like this:</p>
  
  <pre><code>ID2 234 A C 
  ID3 232 G T 
  ID1 123 C T 
  ID4 344 A C 
  ...
  </code></pre>
  
  <p>The <code>IDs</code> are the values of the first column (present in both files). File 1 has more rows/IDs than file 2. 
  All <code>ID</code>s from file 2 are in file 1, but not all <code>ID</code>s from file 1 are in file 2</p>