
CODE: [Copy to clipboard]@echo off
set user=李四
findstr "%user%" user.txt>nul
if %errorlevel% neq 0 goto :not_info
for /f "tokens=4-8" %%a in ('findstr "%user%" user.txt') do (
set name=%%a
set zhiwu=%%b
set zuowei=%%c
set xingbie=%%d
set nianling=%%e
)
echo.
echo.
echo. 信息文件中检索到的登记信息是:
echo.
echo. %name% %zhiwu% %zuowei% %xingbie% %nianling%
echo.
pause
goto :eof
:not_info
CODE: [Copy to clipboard]gawk "/李四/{print $4,$5,$6,$7,$8}" user.txt
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |