Hello i want to merge 3 text files line by line using batch file. The lines contains specials char. and spaces. if file has only one line the code below works but if we have mu
I just copied the answer from this site and extended it to 3 files. I can't provide a more precise solution without further details...
@echo off
setlocal EnableDelayedExpansion
rem First file is read with FOR /F command
rem Second file is read via standard handle 3
rem Third file is read via standard handle 4
3< b.txt 4< c.txt (for /F "delims=" %%a in (a.txt) do (
rem Read next line from b.txt
set /P lineB=<&3
rem Read next line from c.txt
set /P lineC=<&4
rem Echo lines of three files
echo %%a,!lineB!,!lineC!
))