title: reading a simple text file, splitting and sorting the contents using vb
body: <p>I'm quite new to vb and doing simple basics, I have managed to access and read a specific file line by line. If I wanted to split information by a comma or space and then sort alphabetically or numerically, how would I go about this procedure? Would I create a loop within the reading loop to parse the information? A simple to follow example would really help...Thanks!</p>
  
  <pre><code>Dim file As String = "C:\Users\test.txt"
      Dim Line As String
  
  If System.IO.File.Exists(file) = True Then
          Dim objReader As New System.IO.StreamReader(file)
          Do While objReader.Peek() &lt;&gt; -1
              Line = Line &amp; objReader.ReadLine() &amp; vbNewLine
  Loop
  Next
  Label1.Text = Line
  
   objReader.Close()
   Else
   MsgBox("File Does Not Exist")
  
      End If
  </code></pre>