Doubt when joining txt files

-1

Looking at the internet how to merge txt files, I found the CMD command line code below:

for %f in (*.txt) do "%f" >> união.txt

The logic is to loop, grab all the txt files and create a new 'union.txt' file with all of them together.

The same does not work, it opens all files and creates the new one, but the new one goes blank.

Any tips?

    
asked by anonymous 21.11.2017 / 15:46

1 answer

0

I get it resolved this way:

for %f in (*.txt) do type "%f" >> união.txt

The code reads as follows:

for %f in (*txt) // loop all .txt files

do type // the type command was missing it is the write command

"%f" >> união.txt // writes the contents of the files within the union.txt file

    
21.11.2017 / 15:49