Re treey:
最后,为了回应主楼的问题原意,以这个FOR命令版的显示控制例程作为结帖。至于纯DOS下的遍历程序,恕我没有太多的精力了。
:: Disp10.bat - A sample of display 10 characters of front of echo line
:: Will Sort - 14:57 2005-8-1
:: Note: 文中的字符包括中文和英文字符,并且一个中文字算一个字符而非两个
@echo off
if "%1"=="" cmd /v<img src="images/smilies/face-surprise.png" align="absmiddle" border="0">n /c %0 cmdshell & goto :EOF
if exist test2.txt del test2.txt
for /f "tokens=*" %%a in (test1.txt) do (
set line=%%a
echo !line:~0,10!>> test2.txt
)
set line=