3
A relatively simple way is to use Windows CMD.
Using for
+ type
:
cd /d c:\caminho\para\a\pasta
for %f in (*.txt) do type "%f" >> amalgama.out
in place of amalgama.out
you put the desired output name.
You don’t even have to make one .bat
, just run right into prompt command.
Relevant information: I used .out
in the output to avoid double concatenation (add the amalgama.txt
in itself). Any extension other than .txt
serves, but it is convenient to use one that is not "hidden" by Windows. Nothing that a rename
do not solve at the end ;)
Using copy
:
This is a simpler alternative, but it does not force line breaks at the end of each file. It can happen of "paste" two lines if the last of some file does not end with breakage.
cd /d c:\caminho\para\a\pasta
copy /b *.txt amalgama.out
The /b
indicates "binary", but can be used with .txt
s normally, to ignore any special character.
Of curiosity, the /d
used in commands cd
above serves to change drive if necessary while avoiding running cd c:
and cd \caminho
separately, in case the prompt is not open already in the correct unit.
It worked. Perfect! Thanks!
– h1k3r
The
/d
in thecd
did not know! Always forced to enter the unit vlw @Bacco– David