Answer Posted / yogesh
'MERGE CONTENTS OF TWO FILE
Option Explicit
Const conForReading = 1
Const ForAppending = 8
Dim objFSO: Set objFSO = CreateObject
("Scripting.FileSystemObject")
Dim file1,file2,file3,contents1,contents2
Dim strfile1,strfile2,strfile3 'Declare
variables
strfile1=inputbox("Enter path of Source file 1","Copy file
utility"," ")
strfile2=inputbox("Enter path of Source file 2","Copy file
utility"," ")
strfile3=inputbox("Enter path of To Create Target
file","Copy file utility"," ")
Set file1 = objFSO.OpenTextFile(strfile1, conForReading,
False)
Set file2 = objFSO.OpenTextFile(strfile2, conForReading,
False)
Set file3 = objFSO.CreateTextFile(strfile3, ForAppending,
True)
'Set Objects
contents1 = file1.ReadAll
contents2 = file2.ReadAll
'Read file contents
file1.Close
file2.Close
'Close file after use
file3.WriteLine(contents1)
file3.writeLine(contents2)
'Write contents to file
file3.Close
'Close file after use
Set file1 = Nothing
Set file2 = Nothing
Set file3 = Nothing
Set objFSO = Nothing
'freezing memory of objects
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a memory leak? How to avoid it?
What are the features of the c language?
What is bss in c?
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
What Is The Difference Between Null And Void Pointer?
Explain union. What are its advantages?
Can one function call another?
Write a program to show the change in position of a cursor using c
Explain what are its uses in c programming?
What are the different types of constants?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is a nested loop?
What is a static variable in c?