doomsday123
October 8th, 2004, 01:35 PM
Im trying to read each line of a file and output it to a file. I am splitting each line at the "," so i can display them in colums in the listbox. When I click the display button it goes in and readlines the file until readline = "" but for some reason it is skipping every other line. Here is my code.
Private Sub Display()
Dim sr1 As IO.StreamReader = New IO.StreamReader("File.txt")
Dim Data As String
Dim strfrm As String = "{0,0} {1,30}"
Dim count As Integer = 0
Do Until sr1.ReadLine = ""
Data = sr1.ReadLine
Dim Items() As String = Data.Split(",")
lstDisplay.Items.Add(Items(0).PadRight(25, " ") & Items(1))
Loop
sr1.Close()
End Sub
Any help would be great. Thanks.
Private Sub Display()
Dim sr1 As IO.StreamReader = New IO.StreamReader("File.txt")
Dim Data As String
Dim strfrm As String = "{0,0} {1,30}"
Dim count As Integer = 0
Do Until sr1.ReadLine = ""
Data = sr1.ReadLine
Dim Items() As String = Data.Split(",")
lstDisplay.Items.Add(Items(0).PadRight(25, " ") & Items(1))
Loop
sr1.Close()
End Sub
Any help would be great. Thanks.