V
V
vladislavik952017-06-24 11:38:07
cmd/bat
vladislavik95, 2017-06-24 11:38:07

How to write in the code where to move the processed file?

there is a .bat file that does combine txt files into one file, but at the end it adds its own finished result. Therefore, it turns out 2 copies in one file. Therefore, I decided that he would throw the file into another folder so as not to add a copy. How to do it. Here is the code:

cd . >output.txt
FOR %%f IN (*.txt) DO Type "%%f" >>output.txt

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Moskus, 2017-06-24
@vladislavik95

Obviously, create a directory and add the path to it to the name of the result file.
So to speak:

md mycatalog
cd . >mycatalog\output.txt
for %%f in (*.txt) do type "%%f" >>mycatalog\output.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question