- @echo off
- setlocal enabledelayedexpansion
- set /a num=-1
- :main
- set "ot="
- set /a num+=1
- for /f "delims=" %%a in (a.txt) do call :ie "%%a"
- echo.%ot%
- goto :main
-
-
- :ie
- set "var=%~1"
- if "!var:~%num%,1!"=="" (pause&exit)
- call,set "ot=!ot!%%var:~%num%,1%%"
- goto :eof
复制代码
|