merger 2 txt file with specific column

February 23, 2016 at 23:26:03
Specs: Windows 7
hi all,

I have 2 txt file and want merger to new file how to make that with batch command

1.txt

1,2,3,4
1,2,3,4
1,2,3,4


2.txt

A,B,C,D,E,F
A,B,C,D,E,F
A,B,C,D,E,F


I want merger 1.txt and 2.txt to new txt file with format

new.txt

1,2,3,4
1,2,3,4
1,2,3,4
A,B,C,D
A,B,C,D
A,B,C,D


thx


ikur

message edited by ikurniawan


See More: merger 2 txt file with specific column

Report •


#1
February 24, 2016 at 08:03:47
@echo off
copy "1.txt" "new.txt" > nul
for /F "tokens=1-4 delims=," %%i in ('type "2.txt"') do (echo.%%i,%%j,%%k,%%l) >> "new.txt"

message edited by IVO


Report •

#2
February 28, 2016 at 22:43:00
Hi ivo so many thanks it's work for alphabet, but error for date.

1.txt

3047,23/02/2016 15:32:15,1
3047,23/02/2016 15:32:16,2


2.txt
2503,22/02/2016 17:48,1,23/02/2016 08:14
749,22/02/2016 17:48,1,23/02/2016 08:14


new.txt
3047,23/02/2016 15:32:15,1
3047,23/02/2016 15:32:16,2
2503,22/02/2016 17:48,1
749,22/02/2016 17:48,1


Thx

Ikur


Report •

Related Solutions


Ask Question