@echooff SETLOCALENABLEDELAYEDEXPANSION setm=50 for/f%%iin(a.txt)do( set/an+=1 set/ax=!n!/%m%+1 echo%%i>>a!x!.txt)