I have a number of csv files, and I want to concatenate the data in all the csv files in to one. The copy command is working fine for me but I need to remove the header that comes in the output csv file after each csv file is concatenated.
I am using the below code in a batch file:-
@echo off> output.csv
copy /a 1_*.csv Output.csv
Please help
@echo off cls setlocal enabledelayedexpansion if exist output.csv del output.csv dir /a-d /b Data_*.csv>dirfiles.txt for /f "tokens=*" %%1 in (dirfiles.txt) do ( set /p header=<%%1 echo !header!>output.csv ) for /f "tokens=*" %%1 in (dirfiles.txt) do ( more +1 %%1>>output.csv ) del dirfiles.txtPlease come back & tell us if your problem is resolved.