日期:2014-05-16  浏览次数:20959 次

ASP如何从txt中读一个矩阵数据
<%
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim fp
Set fp = fso.OpenTextFile(Server.MapPath("1.txt"),1,true)
Dim n,A(800,800)
Dim r,i,k
i = 0
k = 0
Do While fp.AtEndOfStream
s = Split(fp.ReadLine," ")
Loop
%>
把数据读出来后怎么提取,方便后面的计算啊

------解决方案--------------------
n = 0
Do While Not fp.AtEndOfStream
    s = Split(fp.ReadLine," ")
    For i = 0 To UBound(s)
       A(i, n) = s(i)
    Next
    n = n + 1
Loop

For n = 0 To UBound(A, 2)
    For i = 0 To UBound(A)
        Response.Write A(i, n)
    Next
Next