Hello,
cant someone help me.
I have to txt file with text. something like this:
1.txt
1
2
3
4
2.txt
a
b
c
d
and I need to get this:
output.txt
1 a
2 b
3 c
4 d
Is there a way to get this with .bat script?
Thanks everyone,
Kruno
text merge
Moderator: DosItHelp
Re: text merge
file1.txt and file2.txt are the input files.
Code: Select all
@echo off
setlocal DisableDelayedExpansion
< file2.txt (
for /F "delims=" %%a in (file1.txt) do (
set file2Line=
set /P file2Line=
set "file1Line=%%a"
setlocal EnableDelayedExpansion
echo(!file1Line! !file2Line!
endlocal
)
) >output.txt
pause