数据读取问题?

mtoad 2005-09-20 06:48:24
有一个文本文件,有m行n列,
我要一次取一行进行计算,VB如何实现啦?
...全文
62 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
饮水需思源 2005-09-21
  • 打赏
  • 举报
回复
open c:\text1.txt for input as #a1
do while not eof(a1)
line input #a1,tmpstr
loop
close #a1
of123 2005-09-21
  • 打赏
  • 举报
回复
dim strline as string
dim strcols() as string

open c:\text1.txt for input as #1
do until eof(1)
line input #1,strline
strcols = split(strline, vbTab)
for i = 0 to ubound(strcols)
debug.print strcols(i),
next i
debug.print ""
loop
close #1
sdrcxzy 2005-09-21
  • 打赏
  • 举报
回复
Dim fsoTest As New FileSystemObject, file1 As File, ts As TextStream, s As String
Set file1 = fsoTest.GetFile(“C:\testfile.txt")
Set ts = file1.OpenAsTextStream(ForReading)
'读取一行
s = ts.ReadLine
MsgBox s
ts.Close

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧