how to copy and paste data at the beginning of a file?
Posted: 12 Feb 2011 13:10
Hi i'm trying to extract 10first lines of from a text file and paste it at the beginning of an existing file.
i try this code but when it pastes data it just deletes the existing data .
how could i modify this code?
Thank you
i try this code but when it pastes data it just deletes the existing data .
how could i modify this code?
Code: Select all
@echo off & setLocal enableDELAYedeXpansion
set N=
(for /f "tokens=* delims= " %%a in (myfile) do (
set /a N+=1
if !N! gtr 10 goto :done
echo.%%a
)) > some.txt
:done
Thank you