How to copy the contents of a file into another file multiple times?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to copy the contents of a file into another file multiple times?

  1. #1
    Join Date
    Oct 2016
    Posts
    7

    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

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,661

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


HTML5 Development Center