Board logo

标题: 多字符搜索 [打印本页]

作者: hjkk123     时间: 2008-5-28 21:04    标题: 多字符搜索
大家都知道资源管理器中的搜索功能中的 在搜索助理下面有个可以搜索 文件中的一个字或词组,可是如果要搜索既有ab又有cd两个字符的txt文件 用命令该怎么定位该文件呢 当我在命令提示符下用命令cd切换到目录(小说下面有子文件夹) F:\网络游戏\小说> 用一条什么命令可列出符合条件的所有文件,且包含该文件路径(相对路径和绝对路径都可以) 附: 顺便贴个定位字符的脚本,虽然菜鸟我不喜欢用sendkeys,刚才还是整了个定位字符的脚本,好像在用记事本写东东的时候还好用, 希望对大家有点帮助
set wshshell=createobject("wscript.shell")
line=inputbox("Which line do you want to mark?")
one=inputbox("Which one do you want to mark?")
if not isnumeric(line) or not isnumeric(one) then
 msgbox "You did not specify a number!"
 wscript.quit
elseif line=flase then wscript.quit
elseif one=flase then wscript.quit
else
 line=fix(line)
 if line<1 then
  msgbox "Your line number is invalid"
  wscript.quit
 end if
end if
wscript.sleep(200)
wshshell.sendkeys "^{home}"
 for x=1 to line-1
   wshshell.sendkeys "{down}"
   wscript.sleep 10
 next
wscript.sleep(200)
 for x=1 to one-1
   wshshell.sendkeys "{right}"
   wscript.sleep 10
 next
wshshell.sendkeys "+{right}"
[ Last edited by hjkk123 on 2008-5-30 at 06:37 PM ]

作者: hjkk123     时间: 2008-5-29 18:56
或者什么软件有上述功能的 谁能介绍个给我呀 [ Last edited by hjkk123 on 2008-5-29 at 07:00 PM ]

作者: plp626     时间: 2008-5-29 19:13
目录树内搜索: @for /f “delims=” %%a in ('findstr/ms "ab" *.txt')do findstr "cd" ”%%a“>nul&&echo %%a @pause

作者: hjkk123     时间: 2008-5-29 20:02
不错,谢谢 问最后一下,如果还要找个ef 这条命令怎么改下呢

作者: plp626     时间: 2008-5-29 20:23
::查找包含多个字符串文件路径 格式: Xfind/plp626 ab bc cd ef gh ijklmn @echo off if not %1.==plp626. call%*&exit/b :loop shift for /f %%a in ('start %~s0 :a %*')do findstr/ms %1 %%a if not %1.==. goto:loop pause :a findstr/ms %1 *.txt>nul