Preferably a one-liner, how could I delete a range of lines at the beginning from a large (3MB+) text file in a timely fashion (few seconds max). I've seen solutions using for /f
along with findstr
, but the for loop made it extremely slow, and the tool more
cannot handle larger files without hanging.
@echo off &setlocal
set "testing.txt=%~1"
(for /f "delims=" %%i in ('findstr /n "^" "testing.txt"') do (
set "line=%%i"
for /f "delims=:" %%a in ("%%i") do set "row=%%a"
setlocal enabledelayedexpansion
set "line=!line:*:=!"
if !row! gtr 100 echo(!line!
endlocal
))>output.txt
Here is an attempt. It is incredibly slow. Any recommendations would be appreciated.