combine CSVs w batch

December 12, 2010 at 23:54:10
Specs: Windows XP
Hi,
I would appericaite if someone will reply with details..I have approx hundred folders and have same name files. I want to copy all files from different folder to one folder with different name or merge these files into one file.
Example-
Input:
D:\Products\Moc.csv
D:\Products1\Moc.csv
D:\Products2\Moc.csv
D:\Products3\Moc.csv

output:
D:\output\all_moc.csv

Thanks in advance.


See More: combine CSVs w batch

Report •


#1
December 13, 2010 at 00:34:48
::not tested

@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/s/b moc.csv') do (
type "%%a" >> D:\output\all_moc.csv
)


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
December 13, 2010 at 02:23:15
Thanks buddy!! Its working

Report •

#3
December 22, 2010 at 02:01:51
How do i append folder name also to output file.

Report •

Related Solutions

#4
December 22, 2010 at 12:53:56
@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/s/b moc.csv') do (
>> D:\output\all_moc.csv echo.%%a
type "%%a" >> D:\output\all_moc.csv
)


=====================================
Life is too important to be taken seriously.

M2


Report •


Ask Question