
| Quote: | |
|
CODE: [Copy to clipboard]This can print the 40th line to screen, and use Cmd variables to cut string from the the 6th, use 'for' to set the string as a final variable.more +40 C:\somefile.txt
| Quote: | |
|
CODE: [Copy to clipboard]拷贝上面的代码,粘贴到你的脚本末尾,如果标号dosomething前面非空白最后一行内容不是goto :eof则自行加上。:dosomething
setlocal ENABLEDELAYEDEXPANSION
for /f "delims=: tokens=1,2" %%i in ('findstr /n . %1 ^| findstr "^%2" ') do set "str=%%j"
if "!str:~%3,1!" == "" (echo 该行没有第%3个字符... && goto :eof)
echo !str:~%3,1!
endlocal
goto :eof
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |