I have a CSV file that im reading in, which has 3 fields and un-known lines, as it is constantly updated.

Now Im looking to add a counter, and grouping system...

Here is the code I have thus far:

VB Code:
  1. Dim reader As StreamReader = File.OpenText("file.txt")
  2. Dim line As String = reader.ReadLine()
  3. Dim a() As String
  4. Dim j As Integer
  5. Dim Tester As String
  6. Dim LoopCountA As String
  7. Dim LoopCountB aS Integer = 2
  8. While Not (line Is Nothing)
  9.   a = line.Split(",")
  10.   If LoopCountA <> a(1) Then
  11.     Tester = Tester & LoopCountB & ") "
  12.     Tester = Tester & a(1) & ","
  13.     Tester = Tester & a(2) & vbNewLine
  14.     LoopCountB = 1
  15.     LoopCountA = a(1)
  16.   Else
  17.     LoopCountB += 1
  18.   End If
  19.   line = reader.ReadLine()
  20. End While
  21. reader.Close()
  22. mylabel.text = Tester

Now this sort of works... except for some reason i puts the highest number at the bottom of the list instead of next to the correct numbers. Any reason why? Anyone able to help me out?

Many thanks