Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


concatanating files

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,26849
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> concatanating files
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 concatanating files - 10/10/2005 3:32:48 AM   
  pookie

 

Posts: 1
Score: 0
Joined: 10/10/2005
Status: offline
Has anyone got some code using the file system object for concatanating files together I could have a look at ?
 
 
Post #: 1
 
 RE: concatanating files - 10/10/2005 5:02:41 AM   
  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

(in reply to pookie)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> concatanating files Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts