TEST.BAT --------------------------------------- @echo off setlocal enabledelayedexpansion set GYO=1 for /f %%a in (TEST1.TXT) do ( if "!GYO!"=="4" type TEST2.TXT >>tmp.txt echo %%a>>tmp.txt set /a GYO=!GYO! + 1 ) type tmp.txt > TEST1.TXT del tmp.txt ---------------------------------------