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:
Dim reader As StreadReader = File.OpenText("file.txt") Dim line As String Dim a() As String Dim j As Integer Dim Tester As String Dim LineCount As Integer = 0 While Not (reader.ReadLine() Is Nothing) LineCount += 1 End While For j = 0 To LineCount line = reader.ReadLine() a = line.Split(",") Tester = Tester & a(1) & "," Tester = Tester & a(2) & vbNewLine Next reader.Close() 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![]()




Reply With Quote