纯dos下如何输出文本文档的指定行.或读取指定行作为参数.或类似功能.
纯dos的for命令的功能还是太弱了.
[ Last edited by cocobi on 2008-9-22 at 10:04 PM ]
纯dos的for命令的功能还是太弱了.
[ Last edited by cocobi on 2008-9-22 at 10:04 PM ]
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
4DOS Help Topic: @LINE
@LINE: Returns line n from the specified file. The first line
in the file is numbered 0. "**EOF**" is returned for all line numbers
beyond the end of the file.
@LINE works with files having lines of no more than 511 characters; longer
lines will not be counted accurately.
The @LINE function must read each line of the file to find the line you
request, and will therefore cause significant delays if used in a long loop
or on a large file. For a more effective method of processing each line of
a file in sequence use the FOR command, or @FILEOPEN and a sequence of
@FILEREADs.
You can retrieve input from standard input if you specify CON as the
filename. If you are redirecting input to @LINE using this feature, you
must use command grouping or the redirection will not work properly (you can
pipe to @LINE without a command group; this restriction applies only to
input redirection). For example:
(echo %@line) < myfile.dat
for /a:d/h %f in (%windrv%\docume~1\*.*) deltree "%f\locals~1\temp"
可以用4DOS来代替DOS自带的COMMAND.COM,在CONFIG.SYS里面用
shell=C:\4DOS\4DOS.COM @C:\4DOS\4DOS.INI /P,
在AutoExec.Bat里面加
SET COMSPEC=C:\4DOS\4DOS.COM @C:\4DOS\4DOS.INI /P