I’m trying to sort lines in a file using VBScript (MS Internet Explorer). Basically I read the file and converted all the lines to an array. Basically I need to sort on whatever is written between character 23 and 27 of each line. So basically I can get those characters using MID. These characters are not unique per line (so I can’t use System.Collections.Sortedlist directly, or something similar unfortunately).
I may be able to use System.Collections.Sortedlist and use the characters between 23 and 27 as a key and use an other System.Collections.Sortedlist object as a value, filled with every unique value (so a 2-dimensional array), but will this be the right way? e.g.:
(System.Collections.Sortedlist) {
"0001" => (System.Collections.Sortedlist) {
0 => "0001 some unique value1"
1 => "0001 some unique value2"
2 => "0001 some unique value3"
},
"0002" => (System.Collections.Sortedlist) {
0 => "0002 some unique value1"
1 => "0002 some unique value2"
2 => "0002 some unique value3"
}
}
Is there a better way to handle this?
Also note the output format should be an array again.
As teaser (see also ArrayList, Disconnected Recordset and ArrayList ):
output: