title: Parse two files and merge lines if time-stamp matches
body: <p>I have two data files of the following format:</p>
  
  <p>File1:</p>
  
  <pre><code>date,time,data1,data2,data3
  date,time,data1,data2,data3
  date,time,data1,data2,data3
  </code></pre>
  
  <p>File2:</p>
  
  <pre><code>date,time,data4
  date,time,data4
  </code></pre>
  
  <p>What I want to do is to merge the lines in these two files in such a way that if date and time match then the output should be:</p>
  
  <pre><code>date,time,data1,data2,data3,data4
  </code></pre>
  
  <p>In case the the time-stamp from one file does not match anything in the other file then I can ignore that line. </p>
  
  <p>I'm currently doing this using a combination of awk and join. But I wonder if this is the most effective way to do this or not. </p>
  
  <p>Current working implementation is something like this:</p>
  
  <pre><code> awk 'FS="," {print $1"&amp;"$2 ","$3","$4","$5}' File1 &gt; temp1
   awk 'FS="," {print $1"&amp;"$2 ","$3}' File2 &gt; temp2
   join -t',' -j1 1 -o 1.1,1.2,1.3,2.2,2.3 temp1 temp2 &gt; temp3
   awk 'FS="&amp;" {print $1","$2"}' temp3 &gt; Output
  </code></pre>