title: Compare files line by line to see if they are the same, if so output them
body: <p>How would I go about this, I have files which I have sorted the information in, I want to compare a certain index in that file with an index in another, one problem is that the files are enormously large, millions of lines.  I want to compare line by line the files I have, if they match I want to input both those values along with other values using an index method.</p>
  
  <p>=======================</p>
  
  <p>Let me clarify, I want to take say line[x] the x will remain the same as it is formatted uniformly, I want to run line[x] against line[y] in another file, I want to do this to the whole file and output every matching pair to another file. In that other file I also want to be able to include other pieces from the first file which would be like just adding more indexes such as; line[a],line[b],line[c],line[d], and finally line[y] as the match to that information. </p>
  
  <p>Try 3:</p>
  
  <p>I have a file with information in this format:</p>
  
  <p>#x is a line </p>
  
  <pre><code> x= data,data,data,data,data,data
  </code></pre>
  
  <p>there is millions of lines of that.</p>
  
  <p>I have another file, same format:</p>
  
  <pre><code>    xis a line
      x= data,data,data,data
  </code></pre>
  
  <p>I want to use x[#] from first file and x[#] from second file, I want to see if those two values match, if they do I want to output those, along with several other x[#] values from the second file, which are on the same line.</p>
  
  <p>Did that help at all to understand?
  The format the files are in are like i said:(but there is millions, and I want to find the pairs in the two files because they all should match up)</p>
  
  <pre><code>  line 1  data,data,data,data
    line 2  data,data,data,data
  </code></pre>
  
  <p>data from file 1:</p>
  
  <pre><code> (N'068D556A1A665123A6DD2073A36C1CAF', N'A76EEAF6D310D4FD2F0BD610FAC02C04DFE6EB67',    
  N'D7C970DFE09687F1732C568AE1CFF9235B2CBB3673EA98DAA8E4507CC8B9A881');
  </code></pre>
  
  <p>data from file 2:</p>
  
  <pre><code>00000040f2213a27ff74019b8bf3cfd1|index.docbook|Redhat 7.3 (32bit)|Linux
  00000040f69413a27ff7401b8bf3cfd1|index.docbook|Redhat 8.0 (32bit)|Linux
  00000965b3f00c92a18b2b31e75d702c|Localizable.strings|Mac OS X 10.4|OSX
  0000162d57845b6512e87db4473c58ea|SYSTEM|Windows 7 Home Premium (32bit)|Windows
  000011b20f3cefd491dbc4eff949cf45|totem.devhelp|Linux Ubuntu Desktop 9.10 (32bit)|Linux
  </code></pre>
  
  <p>The order it is sorted in is alphanumeric, and I want to use a slider method.  By that I mean if file1[x] is &lt; file2[x] move the slider down or up depending on whether one value is greater than the other, until a match is found, when and if so, print the output along with other values that will identify that hash.</p>
  
  <p>What I want as a result would be:</p>
  
  <p>file1[x] and its corresponding match on file2[x] outputted to a file, as well as other file1[x] where x can be any index from the line.</p>