CODE: [Copy to clipboard]@echo off setlocal EnableDelayedExpansion for /f "tokens=1* delims=" %%a in ('findstr .* "a.txt"') do ( set /a count+=1 echo 第!count!行%%a )