贴出 批处理 代码:
SCHTASKS
/Create
/SC
DAILY
/TN
hibernate_pc
/TR
"shutdown /h"
/ST
22:00
@echo off & cls title The batch file is in order to locate specified row and column By Frank V1.1 color 1f mode con cols=115 lines=25 rem 设置变量延迟 setlocal enabledelayedexpansion rem 输入参数模块 set /p fieldDelim=Please enter field delimeters: set /p fileName=Please enter the file(qulified name) which you want: set /p specifiedColumnOrder=Please enter the specified column1 number you want to take: set /p specifiedColumnOrder2=Please enter the specified column2 number you want to take: set /p readOutputFileName=Please enter the output file qulified name rem 接收传入参数模块 set fieldDel=!fieldDelim! set /a specifiedColumnOrd=%specifiedColumnOrder% set /a specifiedColumnOrd2=%specifiedColumnOrder2% set fileNam=!fileName! set readOutputFile=!readOutputFileName! ::读取第一行表头的俩 field 以及 指定行的 俩 field ,提示 Missing Operator 的问题没找到原因 for /f "delims=^%fieldDel% tokens=%specifiedColumnOrd%,%specifiedColumnOrd2%" %%i in (%fileNam%) do echo ^%fieldDel%%%i^%fieldDel%^%fieldDel%%%j^%fieldDel%>>%readOutputFile% type %readOutputFile% pause>nul