Awhile back i asked for help with an array or something i really don't recall,,but was answered by .Paul who gave me this code which helped out great.
But now I've run into a slight snag..with trying to add an Import from a txt file feature.
the above code would store the existing data in an ArrayList or Listof(T)
My Import feature would add lines/columns from a text file and show them in a listview.
what i need now is a way to add only items that are not already in the ItemList.
I thought i could do something like this,but then realized that the data in the ItemList was being stored as one long string..on each line..so this won't work :-)
any idea's? anyone
Code:
For Each udtManual In ItemList
item_list.Add(udtManual.StrModel & "|" & _
udtManual.StrDocument & "|" & _
udtManual.StrDocType & "|" & _
udtManual.StrDescription & "|" & _
udtManual.StrByteSize & "|" & _
udtManual.StrFileSize & "|" & _
udtManual.StrStatus & "|" & _
udtManual.StrCRC & "|" & _
udtManual.StrFileName & "|" & _
udtManual.StrManualType)
Next
the above code would store the existing data in an ArrayList or Listof(T)
My Import feature would add lines/columns from a text file and show them in a listview.
what i need now is a way to add only items that are not already in the ItemList.
I thought i could do something like this,but then realized that the data in the ItemList was being stored as one long string..on each line..so this won't work :-)
Code:
For IMPTest As Integer = 0 To ListView1.Items.Count - 1
Dim IMPItem As String = ListView1.Items(IMPTest).SubItems(8).Text
If Not (item_list.Contains(IMPItem)) Then
item_list.Add(ListView1.Items(IMPTest).Text & "|" & _
ListView1.Items(IMPTest).SubItems(1).Text & "|" & _
ListView1.Items(IMPTest).SubItems(2).Text & "|" & _
ListView1.Items(IMPTest).SubItems(3).Text & "|" & _
ListView1.Items(IMPTest).SubItems(4).Text & "|" & _
ListView1.Items(IMPTest).SubItems(5).Text & "|" & _
ListView1.Items(IMPTest).SubItems(6).Text & "|" & _
ListView1.Items(IMPTest).SubItems(7).Text & "|" & _
ListView1.Items(IMPTest).SubItems(8).Text & "|" & _
ListView1.Items(IMPTest).SubItems(9).Text)
Else
MsgBox("It's In There")
End If
Next