-
November 30th, 2016, 12:48 AM
#1
How to copy the contents of a file into another file multiple times?
Hi All,
I have a file, i need to copy the contents of the file into another file with multiple times.
Example:-
The file which i have is having the content as "Hello World". i need to copy the content into multiple times into another file say for ex. 5 times. The output i need is something like below in the new file
Output:-
Hello World
Hello World
Hello World
Hello World
Hello World
Please help me on this.Thanks in Advance!
Regards,
Mani
-
November 30th, 2016, 07:13 AM
#2
Re: How to copy the contents of a file into another file multiple times?
What have you tried?
If you do not close the output file, everything that is written to it will go to the end of the file.
If you close the output file and want to append new data to the end of the file, use a constructor that has the append argument.
Norm
-
December 8th, 2016, 04:43 AM
#3
Re: How to copy the contents of a file into another file multiple times?
Thanks Norm for the reply
i have used the append argument - true in the code. it's working fine.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|