把这个vbs文件放在1.txt所在的目录下运行。- Option Explicit
- Dim fso,f,str1,str2,array1,array2,str
- Set fso = CreateObject("scripting.filesystemobject")
- Set f = fso.OpenTextFile("1.txt",1)
- Do Until f.AtEndOfStream
- str1 = f.ReadLine
- str2 = f.ReadLine
- array1 = Split(str1)
- array2 = Split(str2)
- str = str + array1(1) + " " + array2(1) + vbCrLf
- Loop
- f.Close
- Set f = fso.CreateTextFile("2.txt",true)
- f.Write str
- f.Close
- Set fso = Nothing
- Set f = nothing
复制代码
|