中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-13 00:17
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » [Help] Can Find search for multiple strings in a file at the same time?
Printable Version  779 / 3
Floor1 hzy Posted 2003-07-20 00:00
高级用户 Posts 135 Credits 578
For example: can it search for the two strings cde and ghi in abc.txt at the same time? If so, what should the command format be?
Floor2 hzy Posted 2003-07-20 00:00
高级用户 Posts 135 Credits 578
Also, why can't it be executed like this in a batch file?
for %%a in (c: d: e do dir %%a\ >>%ramdrive%\abc.txt | find "bytes free" %ramdrive%\abc.txt

But it has to be split up like below before it can run. Why?

for %%a in (c: d: e do dir %%a\ >>%ramdrive%\abc.txt

find "bytes free" %ramdrive%\abc.txt



Floor3 hzy Posted 2003-07-20 00:00
高级用户 Posts 135 Credits 578
And also this:
Floor4 willsort Posted 2003-10-31 00:00
元老会员 Posts 1,512 Credits 4,432
Re hzy:

Question 1: FIND "cde" abc.txt | FIND "ghi"

Question 2: FOR is not a single command, so it does not support command-line pipe operations, so anything after | is ignored

Question 3: FIND "free" < e:\abc.txt
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023