i'm trying to write a batch file that
that copy the 10 first lines from a text file (myfile.txt) and paste it
to an existing file(target.txt) at the top of the text.
So i tried this after searching in google but it doesn't work as i want.
@echo off & setLocal enableDELAYedeXpansion set N= for /f "tokens=* delims= " %%a in (myfile.txt) do ( set /a N+=1 if !N! gtr 10 goto :done >> target.txt echo.%%a )
This code just copy the entire myfile to the target file after 10 lines.
any help please