中国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-25 23:44
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » findstr question: How to find "\"???
Printable Version  3,027 / 17
Floor1 xycoordinate Posted 2007-03-15 06:37
中级用户 Posts 228 Credits 493 From 安徽


E:\DOS>set abc=abc E:\123 1111

E:\DOS>echo %abc%|findstr "E"
abc E:\123 1111

E:\DOS>echo %abc%|findstr "E:"
abc E:\123 1111

E:\DOS>echo %abc%|findstr "E:\"

E:\DOS>


Why can't E:\ be found???

[ Last edited by xycoordinate on 2007-3-14 at 09:29 PM ]
Floor2 ccwan Posted 2007-03-15 06:54
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
Try this
Floor3 xycoordinate Posted 2007-03-15 10:32
中级用户 Posts 228 Credits 493 From 安徽
Originally posted by ccwan at 2007-3-14 17:54:
Try this


Thank you, ccwan!

Under your reminder, I looked at
findstr /?
Found:
\x Escape: literal usage of metacharacter x

[ Last edited by xycoordinate on 2009-7-7 at 05:28 ]
Floor4 xycoordinate Posted 2007-03-21 02:10
中级用户 Posts 228 Credits 493 From 安徽
Then how to use findstr to query "space"?
Floor5 ccwan Posted 2007-03-21 02:29
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
It should be like this


Wait, no, the original "findstr /c:" " is correct. The correct translation should be:

It should be like this
Floor6 xycoordinate Posted 2007-03-22 07:36
中级用户 Posts 228 Credits 493 From 安徽
Originally posted by ccwan at 2007-3-20 13:29:
It should be like this


Thank you! find can also be used!

F:\>set abc=123 456

F:\>echo %abc%|findstr /c:" "
123 456

F:\>echo %abc%|find " "
123 456
Floor7 qiansohu Posted 2007-03-24 21:35
新手上路 Posts 4 Credits 8
Floor8 qiansohu Posted 2007-03-24 21:35
新手上路 Posts 4 Credits 8
Floor9 qiansohu Posted 2007-03-24 21:35
新手上路 Posts 4 Credits 8
Floor10 plp626 Posted 2008-01-26 04:51
银牌会员 Posts 1,020 Credits 2,278
Then how to use findstr or find to search for the period "." in English state?
Floor11 qianmo717 Posted 2008-01-26 09:41
初级用户 Posts 32 Credits 68
```@echo off
set abc=abc de.f
echo %abc%|findstr /c:"\."
pause
```
Floor12 plp626 Posted 2008-01-26 14:43
银牌会员 Posts 1,020 Credits 2,278
Brother qianmo717,
Thanks
Learned it,
Floor13 MLQX Posted 2008-05-10 11:03
初级用户 Posts 15 Credits 28
Floor14 knoppix7 Posted 2008-05-10 11:22
银牌会员 Posts 634 Credits 1,287 From cmd.exe
Floor15 MLQX Posted 2008-05-10 11:29
初级用户 Posts 15 Credits 28
But when I run the following code, it always prompts "The command syntax is incorrect"
echo ^>|findstr "\>" &&echo ok
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023