Some days ago one of my friend ask me a problem that he needs to import csv file to a SQL Server database. But the problem is there is a huge number of small files. He does not want to import one by one. He needs to merge or together all files in a single file so that he can import using SQL Server import wizard only one file. Since it was a one time job for reconcilation, I suggest him use a DOS command to merge all files into a single or one file. The DOS command is given below:
For example, you can join file1.txt and file2.txt to a new file named file3.txt:
copy/b file1.txt +file2.txt file3.txtOR:
copy/b *.txt newfilename.txtOR for all files in a folder:
copy/b * "newfilename_with_path"