|
-
May 8th, 2002, 04:34 PM
#1
Two Dimentional Array and Split? Stumped.
I have tried to find an already posted answer to this, but I could not so here goes...
I have a text file that looks like this:
header info line1
header info line 2
header info line 3
9.880662e-001 1.815209e-001 -1.414392e+000 -5.080986e-001 1.729634e-001 -1.791693e-001
9.880662e-001 1.815209e-001 -1.414392e+000 -5.080986e-001 1.729634e-001 -1.791693e-001 -9.064005e-002
9.880662e-001 1.815209e-001 -1.414392e+000 -5.080986e-001 1.729634e-001 -1.791693e-001 -9.064005e-002
9.880662e-001 1.815209e-001 -1.414392e+000 -5.080986e-001 1.729634e-001 -1.791693e-001 -9.064005e-002
9.880662e-001 1.815209e-001 -1.414392e+000 -5.080986e-001 1.729634e-001 -1.791693e-001 -9.064005e-002
9.880662e-001 1.815209e-001 -1.414392e+000 -5.080986e-001 1.729634e-001 -1.791693e-001 -9.064005e-002
I have truncated the real length of the text file to fit in the message board, but I do know how many values are across and how many lines down.
What I want to do is stuff these values into a two dimentional array.
I have this code so far:
Dim myArray() as Double
Dim i as Integer
Open CommonDialog1.FileName For Input As #1
Dim lineNum As Integer
Do Until EOF(1)
Line Input #1, sLine
lineNum = lineNum + 1
If lineNum > 3 Then
For i = 1 To valuesAcross
myArray(lineNum - 3, 1) = Split(CDbl(sLine), " ")
Next i
End If
Loop
Close #1
Its the poulating of the array that has me stumped. Can you please help. I am new to arrays. I understand how they work, but I am new to actually using them
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|