title: Compare contents of a text file based on line number VB2008
body: <p>Let's say I have two text file, I will compare (based on the line numbering of text ->see below) because this is where the unique key is generated.</p>
  
  <p>sample1.txt:</p>
  
  <pre><code>5th line -&gt; _000_000F_01CE2577.B840E640
  </code></pre>
  
  <p>sample2.txt</p>
  
  <pre><code>5th line -&gt; _000_000F_01CE2577.B840E640
  </code></pre>
  
  <p>Now here is my code:</p>
  
  <pre><code>            Dim FILE_NAME As String = "C:\myfiles"
  
              'This is to determine the number of lines in the text file
              Dim count As Integer
              count = 0
  
              Dim obj As StreamReader
              obj = New StreamReader(FILE_NAME)
  
              Do Until obj.ReadLine Is Nothing
                  count = count + 1
              Loop
  
              '------------------------------
              'this is my computation to get the number of line --&gt;disregard this
  
              Dim temp3 As Integer
              temp3 = count - 3
              '------------------------------
  
              obj.Close()
  
              'This is to read all the text in the text file
              Dim fileReader(fs) As String
              fileReader(fs) = My.Computer.FileSystem.ReadAllText(FILE_NAME, _
                          System.Text.Encoding.ASCII)
  </code></pre>
  
  <p>I have stored each file in an array
  Example:</p>
  
  <pre><code>             file[0]
               file[1]
  </code></pre>
  
  <p>Then I have to read each file and its contents, now how will i compare the line of text to each other. i believe i have to use regex. </p>
  
  <p>Please give me some pointers on how to compare the line of text...</p>
  
  <p>e.g. 5th line in sample1.txt == 5th line of sample2.txt</p>
  
  <p>I have to know if they are the same.</p>