Hi
Have text file(with numeric values), With undefined lines and six columns(at the Moment).
Here is my kode, who creates dyn Array
nFile = "FileDir\nList.txt"
ForReading = 1
Dim MyArray()
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = oFSO.OpenTextFile(nFile,1)
If Not objTextFile.AtEndOfStream Then
strReadAll = objTextFile.ReadAll
ArrRow = Split(strReadAll, vbcrlf)
For i = 0 To Ubound(ArrRow)
ArrCol = Split(ArrRow(i), ",")
If i = 0 Then
Redim MyArray(UBound(ArrRow), UBound(ArrCol))
End If
For j = 0 To UBound(ArrCol)
MyArray(i,j) = ArrCol(j)
Next
Next
End If
You can access dimensions of the dyn Array by a
Wscript.Echo UBound(MyArray,1), Ubound(MyArray,2)
My Question, how can i calculate sum of all comluns, no matter lines quantity?
Some ideas or suggestions would be nice.
Best cumpliments
Have text file(with numeric values), With undefined lines and six columns(at the Moment).
Here is my kode, who creates dyn Array
nFile = "FileDir\nList.txt"
ForReading = 1
Dim MyArray()
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = oFSO.OpenTextFile(nFile,1)
If Not objTextFile.AtEndOfStream Then
strReadAll = objTextFile.ReadAll
ArrRow = Split(strReadAll, vbcrlf)
For i = 0 To Ubound(ArrRow)
ArrCol = Split(ArrRow(i), ",")
If i = 0 Then
Redim MyArray(UBound(ArrRow), UBound(ArrCol))
End If
For j = 0 To UBound(ArrCol)
MyArray(i,j) = ArrCol(j)
Next
Next
End If
You can access dimensions of the dyn Array by a
Wscript.Echo UBound(MyArray,1), Ubound(MyArray,2)
My Question, how can i calculate sum of all comluns, no matter lines quantity?
Some ideas or suggestions would be nice.
Best cumpliments