I have a CSV file, comma delimited, three fields and unknown rows as this constantly changes...

I want to break apart the files, and have slightly more control over them. Basically I want to remove the first field, and then do as I please with the other two fields.

Atm I have this code:

VB Code:
  1. Dim reader As StreadReader = File.OpenText("file.txt")
  2. Dim line As String
  3. Dim a() As String
  4. Dim j As Integer
  5. Dim Tester As String
  6. Dim LineCount As Integer = 0
  7. While Not (reader.ReadLine() Is Nothing)
  8.   LineCount += 1
  9. End While
  10. For j = 0 To LineCount
  11.   line = reader.ReadLine()
  12.   a = line.Split(",")
  13.   Tester = Tester & a(1) & ","
  14.   Tester = Tester & a(2) & vbNewLine
  15. Next
  16. reader.Close()
  17. myfield.Text = Tester

Now I get an error when I load this code... Before I tried to make it work with multiple lines, it worked fine. Is anyone able to help me find the problem?

Many thanks