I reran it again and it did work but it took 9 minutes 20 seconds on a file with 6,947 lines in it. File is actually just under 7MB in size.
So I ran it with Dave's Code.
Code: Select all
@echo off
echo %TIME%>davelog.log
setlocal
set "suffix1=%~n1 ."
set suffix=%suffix1:~0,20%
for /f "delims=" %%A in ('findstr /n . %1') do (
set "ln="
set "ln=%%A"
setlocal enableDelayedExpansion
if defined ln set "ln=!ln:*:=!"
echo(!ln!!suffix!>>DaveAppend.txt
endlocal
)
echo %TIME%>>davelog.log
On this same file Dave's code took 3 minutes 13 seconds.
For some reason I was thinking Aacini's code would be faster.