- @echo off
- set "ou1=123.txt"
- set /p ou2=(1,2,3)?
- call :%ou2%order
- pause>nul&goto :eof
- :1order
- for /f "delims=" %%a in ('findstr /n .* %ou1%') do echo %%a
- goto :eof
- :2order
- for /f "delims=" %%a in (%ou1%) do echo %%a
- goto :eof
- :3order
- for /f "skip=2" %%a in (%ou1%) do echo %%a
复制代码
- @echo off
- set "ou1=123.txt"
- set /p ou2=(1,2,3)?
- if %ou2% equ 1 for /f "delims=" %%a in ('findstr /n .* %ou1%') do echo %%a
- if %ou2% equ 2 for /f "delims=" %%a in (%ou1%) do echo %%a
- if %ou2% equ 3 for /f "skip=2" %%a in (%ou1%) do echo %%a
- pause>nul
复制代码
|