本帖最后由 pcl_test 于 2015-11-7 20:00 编辑
vbs- Dim a(),b(),c(),n
- file1 = "A.txt"
- file2 = "B.txt"
- file3 = "C.txt"
- Set fso = CreateObject("Scripting.FileSystemObject")
-
- i=0
- n = InputBox("输入"&file1&"每行重复的次数:",,1)
- Set f = fso.OpenTextFile(file1,1)
- Do While f.AtEndOfStream <> True
- str = f.ReadLine
- For j=1 to n
- ReDim Preserve a(i)
- a(i) = str
- i = i+1
- Next
- Loop
- f.Close
-
- i=0
- n = InputBox("输入"&file2&"每行重复的次数:",,1)
- Set f = fso.OpenTextFile(file2,1)
- Do While f.AtEndOfStream <> True
- str = f.ReadLine
- For j=1 to n
- ReDim Preserve b(i)
- b(i) = str
- i = i+1
- Next
- Loop
- f.Close
-
- i=0
- n = InputBox("输入"&file3&"每行重复的次数:",,1)
- Set f = fso.OpenTextFile(file3,1)
- Do While f.AtEndOfStream <> True
- str = f.ReadLine
- For j=1 to n
- ReDim Preserve c(i)
- c(i) = str
- i = i+1
- Next
- Loop
- f.Close
-
- On Error Resume Next
- Set f = fso.CreateTextFile("合并.txt",2)
- For k=0 to UBound(a)
- f.WriteLine a(k)&","&b(k)&","&c(k)
- Next
- f.Close
- Msgbox "完成"
复制代码
|