Copy multiple file into a single file using cmd command
The following snippet allow you to copy multiple text files into a single text file.
FOR /f %%i IN ('dir /b C:\PATH_DIR_WITH_MULTIPLE_FILE') DO TYPE C:\DIR_WITH_MULTIPLE_FILE\%%i >> C:\DIR_OUTPUT\UNICO_FILE.TXT
In practice the snippet execs a ‘dir’ command on the specified path and for each file it appends the text in the output file.Ecco lo snippet che consente di copiare tanti file in un singolo file di testo.
FOR /f %%i IN ('dir /b C:\PATH_DIR_WITH_MULTIPLE_FILE') DO TYPE C:\DIR_WITH_MULTIPLE_FILE\%%i >> C:\DIR_OUTPUT\UNICO_FILE.TXT
In pratica il comando esegue una dir (su C:\PATH_DIR_WITH_MULTIPLE_FILE) e per ogni file (quindi nell’ordine della dir) effettua un append nel singolo file di output C:\DIR_OUTPUT\UNICO_FILE.TXT.
Lascia un commento