@echo off
setlocal enabledelayedexpansion
set "N=17"
set "count=0"
for /f "tokens=*" %%a in (first_file.txt) do (
if !count! GEQ !N! goto :EOF
echo %%a>>second_file.txt
set /a "count+=1"
)
But you can also try another version of this script. It will look like this (you should declare variables to run this script):
set count=0
for /f "skip=2 tokens=*" %%a in (%file_name%) do (
set /a count=!count!+1
if /i !count! leq N echo %%a>>new.txt
)
Hope you'll find these scripts useful.
setlocal enabledelayedexpansion
set "N=17"
set "count=0"
for /f "tokens=*" %%a in (first_file.txt) do (
if !count! GEQ !N! goto :EOF
echo %%a>>second_file.txt
set /a "count+=1"
)
But you can also try another version of this script. It will look like this (you should declare variables to run this script):
set count=0
for /f "skip=2 tokens=*" %%a in (%file_name%) do (
set /a count=!count!+1
if /i !count! leq N echo %%a>>new.txt
)
Hope you'll find these scripts useful.
No comments:
Post a Comment