1.

Solve : Copy contents of file1,file2 into file3?

Answer»

Sir,
I want to add contents of file1.txt , file2.txt and file3.txt into file4.txt
File1.txt & File3.txt has DATA BUT file2.txt has no data i,e. that is blank
1. When I type COPY FILE1.TXT + FILE3.TXT FILE4.TXT
I find exact result and file4.txt receives all data of file1.txt and file3.txt
BUT
2. When I type COPY FILE1.TXT + FILE2.TXT + FILE3.TXT FILE4.TXT
I find NO result and file4.txt receives NOTHING i,e. all data of file1.txt and file3.txt
is not copied in file4.txt

My PROBLEM : I have to include also those files which have no data because there are several files and these are to be copies in a single file through batch file.
How can I get correct result by adding files having data and having no data

Your' sincerely
Lohanione WAY, would be to create temporary files to merge the results of multiple copy commands.


Code: [SELECT]copy file1.txt+file2.txt tempout.tmp
for %%P in (<list of remaining files>) do
(
copy tempout.tmp+%%P tempout2.tmp
erase tempout.tmp
ren tempout2.tmp tempout
)
redirect > and append >> will also work.

C:\>type file1.txt > file4.txt

C:\>type file2.txt file3.txt >> file4.txt



Discussion

No Comment Found