![]() |
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-12 16:01 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » Text search: compare characters |
| Printable Version 658 / 1 |
| Floor1 q115643492 | Posted 2009-09-30 13:34 |
| 新手上路 Posts 6 Credits 6 | |
|
I’d like to ask for a batch file to implement the following function:
I already have a text file ID.txt, with no spaces on each line, and its contents are for example: abc system 2753 60th anniversary Then I want to use the command set /p= to input text, any text is fine, and compare the input text with these strings in ID.txt. If the input text contains any of the above strings, then exit. For example, if I input "system file" or "system", since it contains "system", then it matches the condition above, so it should exit. But if I only input "sys" or “series”, then it does not match the condition above, and should not exit. Please, experts, help! [ Last edited by q115643492 on 2009-9-30 at 14:59 ] |
|
| Floor2 everest79 | Posted 2009-09-30 15:48 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |