How to merge or combine multiple files
If you have any requirement to merge multiple files (like .txt, .sql) of similar file types into a single consolidated file. For example, we might have many .SQL files and it is time taking work to click every .SQL file and run those commands on SSMS (SQL Server Management Studio), to make this job easy we can consolidate all these statements in the order how it was showing in the folder to a single file and run those commands at one go. Isn’t easy enough?
Following the DOS command which helps you to do so.
copy *.txt newfile.txt
in the above, the DOS will look into the folder where the command is pointed and finds all the TXT files and merges those content to a single new file named as newfile.txt and place at same folder path.