vbs- Set fso = CreateObject("Scripting.FileSystemObject")
- Set objDict = WSH.CreateObject("Scripting.Dictionary")
- Set f1 = fso.OpenTextFile("1.txt", 1)
- Set f2 = fso.OpenTextFile("2.txt", 1)
- Set f3 = fso.CreateTextFile("3.txt", 2)
- Do While f2.AtEndOfStream <> true
- line = f2.ReadLine
- If not objDict.Exists(line) Then objDict.Add line, 1
- Loop
- Do While f1.AtEndOfStream <> true
- line = f1.ReadLine
- If objDict.Exists(line) Then f3.WriteLine line
- Loop
复制代码
|