I've got a CSV file I'm trying to read in. Each line in the file should be a separate entry in the array such that the sample file of
20,1,2,3,4,5,6,7,8
30,1,2,3,4,5,6,7,8
40,1,2,3,4,5,6,7,8
should be a 3x9 array and "look" like this:
[(20,1,2,3,4,5,6,7,8)
(30,1,2,3,4,5,6,7,8)
(40,1,2,3,4,5,6,7,8)]
My code is as follows:
dim $testArray[1][9]
while 1
$testCase = FileReadLine($testFile)
if @error = -1 then ExitLoop
$testArray[$i] = StringSplit($testCase, ",")
$i = $i + 1 ;Increment $i
redim $testArray[$i][9]
WEnd
I keep getting this error:
Main.au3 (188) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$testArray[$i] = StringSplit($testCase, ",")
^ ERROR
->14:14:39 AutoIT3.exe ended.rc:1
No matter what variable I change in the $testarray[1][9] bit, it doesn't work, even if I remove the redim and only read in 1 line.
Would appreciate some help on this