How can I extract lines 3 through 90 from a file and pass them to a new *.txt file! Thanks!
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
| Rater | Score | Time |
|---|---|---|
| everest79 | +15 | 2007-04-27 02:17 |
@echo off
for /l %%a in (3,1,90) do call :need %%a
:need
for /f "tokens=1* delims=:" %%i in ('findstr /n . 1.txt') do if %%i==%1 echo %%j>>2.txt
@echo off
for /l %%n in (3,1,90) do call :need %%n
pause
exit
:need
set /a line=%1-1
for /f "skip=%line% delims=" %%i in ('more test.txt') do (
echo %%i
goto :eof
)@echo off
setlocal EnableDelayedExpansion
for /l %%n in (31,90) do call :need %%n
pause
exit
:need
set /a line=%1-1
for /f "skip=%line% delims=" %%i in ('findstr /n .* "test.txt"') do (
set "str=%%i"
set "str=!str:%1:=!"
if not "!str!" == "" (echo !str!) else echo.
goto :eof
)