VB如何读取指定文本信息

来源:百度知道 编辑:UC知道 时间:2024/05/12 16:13:36
Run Target Data:
1 1 0.000
2 2 0.000
3 3 0.000
再这段文字上面还有很多行,其中包括空白行,也就是该段文字的行号不确定。我想读到Run Target Data:这行下面的内容,并将行列呼唤,也就是得到下面这样的内容:
1 2 3
1 2 3
0.000 0.000 0.000
该代码应该怎么写呢?请大侠们指点。
补充一下,是在文本文件中

用一个listbox控件来达到要求
open filename for input as #1
dim a() as string,strline as string
while not (#1).eof.(#1)
Line Input #1, strline
if trim(strline)<>"" then
while instr(strline," ")<>0 '将2个空格转换为1个空格
strline=replace(strline," "," ")
wend
a=split(strline," ")
for i=0 to ubound(a)-1
if list1.listcount=0 then
list1.additem a(i)
else
list1.list(i+1)=list1.list(i+1) & " " & a(i)
end if
next
end if
wend
close #1
open filename2 for output as #1''保存文件
for i=1 to list1.listcount
print #1,list1.list(i)
next
close #1

这段文本在 文本文件中,还是别的什么地方?