Hopefully I explained my need well enough in the Thread title. If not I will elaborate further.
I have a list of array that I am populating with a list of string. I need to sort the list of array (outer) by two items in the list of string (inner).
The real data i'll be using has any number of batches which each include 25 items indexed by sequence number. The data comes randomly to me as a list of string which i populate to a list of array. I'd really like to be able to sort it by batch and sequence within the batch.
So i end up with something like this
batch 1, seq 1
batch 1, seq 2
batch 2, seq 1
batch 2, seq 2
ect.
This is probably quite easy for some however I am just learning vb.net. I am using visual studio 2008 if it helps.
I have the following code thus far to build a pretend list of list and am trying to play with the sorting on my own now. Hopefully with your help this is a quick and painless learning experience for me and a star for you.
I've done some googling but am not really sure what a good search term for this example would be, even that would help me alot.
[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
I have a list of array that I am populating with a list of string. I need to sort the list of array (outer) by two items in the list of string (inner).
The real data i'll be using has any number of batches which each include 25 items indexed by sequence number. The data comes randomly to me as a list of string which i populate to a list of array. I'd really like to be able to sort it by batch and sequence within the batch.
So i end up with something like this
batch 1, seq 1
batch 1, seq 2
batch 2, seq 1
batch 2, seq 2
ect.
This is probably quite easy for some however I am just learning vb.net. I am using visual studio 2008 if it helps.
I have the following code thus far to build a pretend list of list and am trying to play with the sorting on my own now. Hopefully with your help this is a quick and painless learning experience for me and a star for you.
I've done some googling but am not really sure what a good search term for this example would be, even that would help me alot.
Code:
Dim LineArray As New List(Of Array)
Dim Lines As New List(Of String)
Dim batch As Integer
Dim Sequence As Integer
For batch = 2 To 1 Step -1
For Sequence = 5 To 1 Step -1
Lines.Add(Str(batch))
Lines.Add(Str(Sequence))
LineArray.Add(Lines.ToArray)
Lines.Clear()
Next
Next
[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]