处理文件
上一篇 / 下一篇 2009-08-11 17:17:32 / 个人分类:问题
查看( 302 ) /
评论( 6 )
TAG:
- dreamsea123 发布于2009-08-11 17:37:51
-
修改后的代码
我修改了一下:
Dim str1,str2,a(3),b(3)
str1="在线无数据:"
str2="不在线,无数据:"
a(0)="001"
a(1)="002"
a(2)="003"
b(0)="005"
b(1)="006"
b(2)="007"
inportfile a ,b
Function inportfile (a1,b1)
For i=0 to 2
str1=str1+a1(i)+","
str2=str2+b1(j)+","
Next
Dim fso,f1
Set fso=CreateObject("Scripting.FileSystemObject")
Set f1=fso.CreateTextFile("c:\textfile.txt",true)
f1.Write(str1)
f1.WriteBlankLines(1)
f1.Write(str2)
f1.close
End Function
- cuixiaoyan1020 发布于2009-08-11 17:45:33
-
回复 2# 的帖子
好像数据有点不对,上部分都对,谢谢,你再改改
- cuixiaoyan1020 发布于2009-08-11 17:48:48
-
回复 2# 的帖子
为何第二句实现的总是:005,005,005?如何实现是005,006,007呢?麻烦你再改改,谢谢
- dreamsea123 发布于2009-08-11 17:48:59
-
简单,将j换成i就可以了
Dim str1,str2,a(3),b(3)
str1="在线无数据:"
str2="不在线,无数据:"
a(0)="001"
a(1)="002"
a(2)="003"
b(0)="005"
b(1)="006"
b(2)="007"
inportfile a ,b
Function inportfile (a1,b1)
For i=0 to 2
str1=str1+a1(i)+","
str2=str2+b1(i)+","
Next
Dim fso,f1
Set fso=CreateObject("Scripting.FileSystemObject")
Set f1=fso.CreateTextFile("c:\textfile.txt",true)
f1.Write(str1)
f1.WriteBlankLines(1)
f1.Write(str2)
f1.close
End Function
- cuixiaoyan1020 发布于2009-08-11 17:51:46
-
回复 5# 的帖子
我刚想跟你说将j改为i 呢?谢谢
- maomao257 发布于2009-08-11 18:55:23
-
数组下标