I tried to copy one file to another from starting line upto a limit. ie., line 1 to 10(file1.txt)->file2.txt but while writing "!" is skipped. what can i do for to solve it. Any help will be thankful.
The loop for that function is given below.
%NF%-> new file.
%EF%-> existing file
%1% -> line number(passed from another part)
:_doit
findstr /N /R "." %EF%|findstr /B /C:"%1:">nul
if errorlevel 1 (
echo. >>%NF%
) else (
for /f "tokens=1 delims=" %%a in ('findstr /N /R "." %EF%^|findstr /B /C:"%1:"') do (
if [%%a] EQU [] (
echo. >>%NF%
) else (
echo %%a >>%NF%
)
)
)