Converting a 1-Dimensional array to a 2- Dimensional array
Val_0_0,Val_0_1,Value_0_2,Value_0_3
Val_1_0,Val_1_1,Value_1_2,Value_1_3
Val_2_0,Val_2_1,Value_2_2,Value_2_3
Val_3_0,Val_3_1,Value_3_2,Value_3_3
Val_4_0,Val_4_1,Value_4_2,Value_4_3
Val_5_0,Val_5_1,Value_5_2,Value_5_3
Val_6_0,Val_6_1,Value_6_2,Value_6_3
txt field as above...
I read into a one dimensional array using:
Dim objFSO, objTS
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile("a:\value_list.txt")
''Read into a string
Dim s
s = objTS.ReadAll
''Create One Dimensional Array by splitting them at line feed/carriage
return character
Dim one_d_array
one_d_array = split(s, vbCrLf)
'''I have a one dimensional array if I was to loop through and line breaks
it would print to the screen as above.
For i = 0 to ubound(one_d_array) ''scroll through array one by one
response.Write(one_d_array(i) & "<BR>")
Next
What I want to do here is actually turn it into a two dimensional array
And split it on the commas ''Obviously the below does not work.
For i = 0 to ubound(one_d_array)
'two d_array(i) = aFile 'split(aFile,",")
next
It's easy for me to take a two or three dimensional array and make it one
dimensional but for some reason
I'm drawing blanks trying to do it the other way around.
Thanks in advance for any help.
Pejo.
|