联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Set fso = CreateObject("Scripting.FileSystemObject") source = "a.txt" strFind = "a,b,c,d,e,f" strFind = Split(strFind,",") Num = Ubound(strFind) Set f = fso.OpenTextFile(source,1) While not f.AtEndOfStream strRead = f.ReadLine For i = 0 to Num If instr(strRead,strFind(i))>0 Then msgbox strRead End If Next Wend f.Close
Originally posted by zh159 at 2007-12-16 14:44: Set fso = CreateObject("Scripting.FileSystemObject") source = "a.txt" strFind = "a,b,c,d,e,f" strFind = Split(strFind,",") Num = Ubound(strFind) ...
Set fso = CreateObject("Scripting.FileSystemObject") source = "a.txt" strFind = "a,b,c,d,e,f" strFind = Split(strFind,",") Num = Ubound(strFind) ...
zh159理解错我的意思了,我是说strFind的值从某一个文本中取得,不是后面跟一串,总不可能我要找50个,strFind后面打上50个变量吧!!
zh159 misunderstood my meaning. I mean that the value of strFind is obtained from a certain text, not followed by a string. It can't be that I need to find 50 items and type 50 variables after strFind!!
Originally posted by lotus516 at 2007-12-17 08:12: zh159理解错我的意思了,我是说strFind的值从某一个文本中取得,不是后面跟一串,总不可能我要找50个,strFind后面打上50个变量吧!!
Set fso = CreateObject("Scripting.FileSystemObject") source = "a.txt" target = "b.txt" Set f = fso.OpenTextFile(source,1) strFind = f.ReadAll f.Close Set f = fso.OpenTextFile(target,1) While not f.AtEndOfStream strRead = f.ReadLine If instr(1,strFind,strRead,1)=0 Then str = str & strRead & vbCrLf End If Wend f.Close msgbox str
Originally posted by lotus516 at 2007-12-17 08:12: zh159 misunderstood my meaning. I mean that the value of strFind is obtained from a certain text, not followed by a string of variables. It's impossible that I need to find 50 things and put 50 variables after strFind!!