| |
sethsdad
Posts: 115
Score: 0
Joined: 4/4/2005
From: USA
Status: offline
|
one approach: Const ForReading = 1 Const ForWriting = 2 dim strLog, in1, in2, out1 in1 = inputbox("name and path of file 1:") in2 = inputbox("name and path of file 2:") out1 = inputbox("name and path of concat file:") Set objFSOIn = CreateObject("Scripting.FileSystemObject") Set objFSOOut = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSOIn.OpenTextFile _ (in1, ForReading) Set objTextOut = objFSOIn.OpenTextFile _ (out1, ForWriting) Do Until objTextFile.AtEndOfStream strLog = objTextFile.Readline if mid(strlog,1,1)<>"1" and mid(strlog,19,1)<>" " then ObjTextOut.write left(StrLog,20) & " 2 " & mid(Strlog,20) & vbcrlf Loop Set objTextFile = objFSOIn.OpenTextFile _ (in2, ForReading) Do Until objTextFile.AtEndOfStream strLog = objTextFile.Readline if mid(strlog,1,1)<>"1" and mid(strlog,19,1)<>" " then ObjTextOut.write left(StrLog,20) & " 2 " & mid(Strlog,20) & vbcrlf Loop you could also do this with args, but that seems like a long way to do copy filea+fileb filec
|
|