zhenglj 当前离线
列兵
@echo off for /f "tokens=1 delims=. " %%a in ("bbs bathome.net") do echo %%a for /f "tokens=2 delims=. " %%b in ("bbs bathome.net") do echo %%b for /f "tokens=3 delims=. " %%c in ("bbs bathome.net") do echo %%c pause>nul复制代码
TOP
wangqi0077 当前离线
一级士官
@echo off color a for /f "delims=." %%i in (1.txt) do echo %%i echo _______________________________________ for /f "tokens=2" %%i in (1.txt) do echo %%i pause复制代码
sotary 当前离线
二级士官
@echo off for /l %%a in (1,1,100) do echo %%a pause>nul for /l %%a in (1,2,99) do echo %%a pause>nul set str="bbs bathome.net" for /f "tokens=1 delims==. " %%a in (%str%) do echo %%a for /f "tokens=2 delims==. " %%a in (%str%) do echo %%a for /f "tokens=3 delims==. " %%a in (%str%) do echo %%a pause>nul for /f "tokens=1-3 delims==" %%a in (test.txt) do echo %%a pause>nul for /f "tokens=2 delims== " %%a in (test.txt) do echo %%a >nul @echo on复制代码
mangci 当前离线
上等兵
@ echo off for /f "tokens=*" %%i in (f:\test.txt) do echo %%i for /f "tokens=2" %%i in (f:\test.txt) do echo %%i pause复制代码
for /l %%i in (1.1.100) echo %%i 复制代码
for /l %%i in (1.2.99) echo %%i 复制代码
@ echo off set "str=bbs bathome.net" echo %str% for %%i in (%str%) do echo %%i 复制代码
for /l %i% in (1.1.100) do echo %i% for /l %i% in (1.2.99) do echo %i% 复制代码
xiaobat 当前离线
@echo off set xxx=bbs buthome.net for /f "tokens=1-3 delims=. " %%i in ("%xxx%") do set s1=%%i && set s2=%%j && set s3=%%k echo %s1% echo %s2% echo %s3% pause>nul复制代码
@echo off cls for /f "tokens=1-3" %%i in (f:\test.txt) do echo %%i %%j %%k for /f "tokens=2" %%i in (f:\test.txt) do echo %%i pause复制代码
@echo off cls for /f "tokens=1-3" %%i in (test.txt) do echo %%i %%j %%k for /f "tokens=2" %%i in (test.txt) do echo %%i pause复制代码
@echo off set yyy=bbs bathome.net echo %yyy% for /f "tokens=1" %%i in ("%yyy%") do echo %%i (for /f "tokens=1 delims=." %%i in ("%yyy%") do echo %%i) >1.txt for /f "tokens=2" %%i in (1.txt) do echo %%i for /f "delims=. tokens=2" %%i in ("%yyy%") do echo %%i pause复制代码
634175535 当前离线
fableleo 当前离线
@echo off for /f "tokens=1-3 delims=. " %%i in ("bbs bathhome.net") do ( echo %%i echo %%j echo %%k ) pause>nul复制代码
@echo off for /f "tokens=1-3 delims=. " %%i in ("bbs bathhome.net") do echo %%i ^ %%j ^ %%k pause>nul复制代码
@echo off for /l %%i in (1,1,100) do echo %%i pause>nul复制代码
rumeng83 当前离线
@echo off for /f "tokens=1-3 delims=._" %%i in ("bbs_bathome.net") do (echo %%i &echo %%j &echo %%k) pause>nul复制代码
原帖由 tianya520feng 于 2010-2-1 10:20 发表 我看了前三十贴,第三题的回复都是错的,正确结果如下: @echo off for /f "tokens=1-3 delims=. " %%i in ("bbs bathome.net") do (echo %%i &echo %%j &echo %%k) pause>nul