If you want help you must first try, then tell what you tried and how it failed. But don't be surprised if we just provide hints so that you will earn your grade
@echo off
setlocal enabledelayedexpansion
set filecontent=
for /f "delims=" %%a in (1.txt) do (
set currentline1=%%a
)
for /f "delims=" %%a in (2.txt) do (
set currentline2=%%a
set filecontent=!currentline1!!currentline2!
)
echo %filecontent% >> 3.txt
ok I tried! =] but this only concentenates last lines of txt files...
another version this unites all text lines from 1.txt and 2.txt in one large line:
@echo off
setlocal enabledelayedexpansion
set filecontent=
set filecontent2=
for /f "delims=" %%a in (1.txt) do (
set currentline=%%a
set filecontent=!filecontent!!currentline!
)
for /f "delims=" %%a in (2.txt) do (
set currentline2=%%a
set filecontent2=!filecontent2!!currentline2!
)
echo %filecontent%%filecontent2% >> 3.txt
i'ts not like i'm not trying Phil! posting in forum is last resort after googling and trying myself to create batch file =]
@echo off
set f1=1.txt
set f2=2.txt
(
for /f "delims=" %%a in (%f1%) do (
setlocal enabledelayedexpansion
set /p line=
echo(%%a!line!
endlocal
) >> 3.txt
)<%f2%
pause > nul