by Amresh kumar (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 15th April 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This code reads a comma separated text file,split the lines based on comma and then display then into a list box.
Dim textfile As String
Dim strArray() As String
Open "C:\test.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, textfile
strArray = Split(textfile, ",")
For i = 0 To UBound(strArray)
If Not Trim(strArray(i)) = "" Then
List1.AddItem strArray(i)
End If
Next
Loop
Close #1
End Sub
No comments have been posted about This code reads a comma separated text file,split the lines based on comma and then display then in. Why not be the first to post a comment about This code reads a comma separated text file,split the lines based on comma and then display then in.