title: compare two files
body: <p>I have two files in this format</p>
  
  <pre><code>file1= filename val1 val2
  file2= filename val3 val4
  </code></pre>
  
  <p>I want to compare filenames and if they have the same names , i want to get a third file like this-</p>
  
  <pre><code>filename val1 val2 val3 val4
  </code></pre>
  
  <p>I am picking a filename from <code>file1</code> and going across <code>file2</code> to see if i get it. Then seeking pointer back to the top of <code>file2</code> for the next filename..is there a more efficient way of doing it?</p>