I have got plenty of *.cpp files in my directory. I have successfully merged file using the below command which i got from one of the sites online.
for %f in (*.cpp) do type "%f" >> Merged.doc
Now i have a file (Merged.doc) with the contents of all my .cpp files. I want to add blank page at the end of each .cpp while merging or would like to have each .cpp files in different pages in the Merged file .
As the below command (from another question). Is there any command similar to :
type *.cpp > merged.doc
Here each file starts after a newline, like this it should start in a new page.
EDIT
What if i need to add a four lines of text before each program.
Suppose if i want to add the Date associated with each file in the line Date : DD-MM-YYYY and the file name with File Name : abcd.cpp(I don't want his .cpp).
What i did :
@echo off
cd C:\programs
echo ^<html^>^<head^>^<style^> pre {page-break-after: always;} ^</style^>^</head^>^<body^> >merged.html
for /r %%f in (*.cpp) do (
echo ^<pre^>
echo File Name :(Here i want the date associated with each file without the extension .cpp)
echo File Description :
echo Author :Name
echo Date :(Here the date associated with each program)
echo.
type "%%f"
echo ^</pre^>
) >>merged.html
echo ^</body^>^</html^> >> merged.html
ERROR in the resultant file
After #include there is no <isotream.h> or <conio.h> or <string.h> or <proccess.h>.But with my original program file it is all available. It does not have the whole program only the half part of each program is on the resultant file. I'm new to batch scripting. What is wrong with my batch file.