I wish to do the following things:
a) Append the first three lines from the file "file1.txt" at the end of another file "file2.txt"
b) Run a program "prog1.cpp" which uses the file file2.txt.
c) Delete the three lines appended at the end of the file "file2.txt". and append next three lines from the file "file1.txt" to file "file2.txt".
d) Run the program "prog1.cpp" which uses the changed file file2.txt".
I need to do the above steps again and again.
I do not how to implement it. Please guide me with how to proceed.