I'm not about to have fully understood the statement, but here's my proposal.
Code: Select all
; Read Log 2.0
; Simple, quick and dirty version for learning
; Tutorial for user coming from other Basic
; Do this at home but dont do this at work ;-)
; Explain how to use StringField to split text line
; and Trim to remove unwanted char
; Array are Zero base, change if you want
; Modified with new informations
n = 76
Dim dm$(n,n) ; To use as fixed decimal, I store values as text. If you want decimal, use dm.f(n,n)
Dim array1$(n)
Dim array2$(n)
; ReadFile instead of OpenFile can open file (readonly) event if shared (windows only)
If ReadFile(0, "example.txt")
While Not Eof(0)
TmpLine$ = ReadString(0)
id = Asc( Left(TmpLine$, 1) ) ; ASCII value of first char of line
i + 1 ; increment i (can be write as i = i + 1)
Select id
Case 34
; Double-quote
Debug "Line " + Str(i) + " Part 1 : " + TmpLine$
array1$(D1) = Trim( StringField(TmpLine$, 1, ","), Chr(34) )
array2$(D1) = Trim( StringField(TmpLine$, 2, ","), Chr(34) )
D1 + 1
Case 48 To 57
; number 0 to 9
Debug "Line " + Str(i) + " Part 2 : " + TmpLine$
RTrim(TmpLine$) ; remove spaces at end of line
k = 1
For j = 0 To CountString(TmpLine$, " ")
dm$(D2, j) = StringField(TmpLine$, k, " ")
; decimal version below (need conversion ValF ou ValD)
; dm(D2, j) = ValF(StringField(TmpLine$, k, " "))
k + 1
Next
D2 + 1
EndSelect
Wend
CloseFile(0)
Else
Debug "Uh? I can't find datafile :-/"
End
EndIf
Debug "--------- Results ---------"
Debug "--------- Matrix 1"
For i = 0 To D1 - 1
Debug "array1$(" + RSet(Str(i), 2) + ") = " + LSet(array1$(i), 30) + " - array2$(" + RSet(Str(i), 2) + ") = " + array2$(i)
Next i
Debug "--------- Matrix 2"
For i = 0 To D2 - 1
Debug "--- dm(" + Str(i) + ") ---"
For j = 0 To 11
Debug " dm$(" + RSet(Str(i), 2) + "," + RSet(Str(j), 2) + ") : " + dm$(i, j)
; Debug " dm(" + RSet(Str(i), 2) + "," + RSet(Str(j), 2) + ") : " + StrF(dm(i, j))
Next j
Next i
End
(horrible) Debug output at the end is for testing only, don't worry

You can use Debugger / VariableViewer instead.