storing list into an array
Hi, i have a csv file with two columns. column on is the name of a set of tools, and column 2 has the list of tools in each set.
ex.
Name of Set Names in set
Good number1
Good number2
Good number3
Bad number4
Bad number5
etc.
So far I have code that will separate the two columns and put them into listboxes. The first listbox contains only one of the set names, not all the multiple names since that would be redundant. The second listbox contains all the names of the set. However, what I want to do is when set "Good" is selected, only the names in the set appear in the 2nd listbox. How could I do that?
The code i have now to separate the lists is this...
Dim strPath As String
Dim SR As StreamReader
strPath = "C:\Desktop\csv1.csv"
SR = New StreamReader(strPath)
Do While SR.Peek() <> -1
Dim strfilestring As String = SR.ReadLine
If strfilestring <> "" Then
Dim filetext() As String = Split(strfilestring, ",")
Dim found As Boolean = False
For i As Integer = 0 To ListBox1.Items.Count - 1
If ListBox1.Items.Item(i).ToString = filetext(0) Then
found = True
Exit For
End If
Next
If found = False Then
ListBox1.Items.Add(filetext(0))
End If
ListBox2.Items.Add(filetext(1))
End If
Loop