You can use MORE +1 to display all but the first line.
>new.csv ( type file1.csv more +1 file2.csv more +1 file3.csv REM etc. )
Obviously, you can adjust the number of lines to skip in each file as needed.
To merge all csv files in the current folder: Edit: changed to not use the newly created csv output as input
@echo off setlocal set first=1 >new.csv.tmp ( for %%F in (*.csv) do ( if defined first ( type "%%F" set "first=" ) else more +1 "%%F" ) ) move /y new.csv.tmp new.csv >nul
Or you can use FOR / F to avoid processing the newly created file:
@echo off setlocal set first=1 >new.csv ( for /f "eol=: delims=" %%F in ('dir /b /ad *.csv') do ( if defined first ( type "%%F" set "first=" ) else more +1 "%%F" ) )
Obviously, this only works if all the csv files are in the same format.
EDIT 2015-07-30: There are some limitations:
- Tabs will be converted to spaces
- Each source CSV file must contain less than 64 thousand lines
source share