China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-02 13:20
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » Proceeding to the search string issue in find View 2,516 Replies 17
Original Poster Posted 2008-07-11 21:33 ·  中国 浙江 台州 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
find "ati" new.ini && 7z.exe x "vga\ati.7z" -oc:\windows\drivers\vga\ati

There is a problem here:
In the NEW.INI file, there is a part where it's identifying the graphics card and extracting... %<0@V"s
FINDSTR: ignoring /c !B


GPT @pdati
MB) ~{1.|W{`u>
This will search for the incorrect ATI. I want to search for ATI chips, not this.
Is there a way to only search for the independent word "ATI" and not a word that contains the word ATI!?
The meaning may not be clear. Anyway, I just want to search for ATI alone!
Hope the expert can answer!
Floor 2 Posted 2008-07-11 22:01 ·  中国 浙江 台州 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
Bump it myself, waiting for experts to answer!
Floor 3 Posted 2008-07-11 23:11 ·  中国 湖北 武汉 联通
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
findstr /ic:"\<ati\>" new.ini
Floor 4 Posted 2008-07-11 23:15 ·  中国 浙江 台州 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
Thank you, moderator LXMXN! I've saved it!
Floor 5 Posted 2008-07-11 23:20 ·  中国 浙江 台州 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
By the way, how to understand "\<ati\>"
Floor 6 Posted 2008-07-11 23:23 ·  中国 浙江 台州 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
Is "\<ati\>" the meaning of a space?
Floor 7 Posted 2008-07-11 23:36 ·  中国 浙江 台州 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
I ran it but it didn't succeed!
findstr /ic:"<\ati\>" new.ini &&md 1
There is a NEW.INI in the directory with only 3 characters "ATI" in it, but I can't create the 1 folder. I don't know why!
Floor 8 Posted 2008-07-13 00:45 ·  中国 湖北 武汉 武昌区 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Because you are too careless, take a close look at how my command format is written.
Floor 9 Posted 2008-07-14 03:57 ·  中国 浙江 台州 临海市 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
findstr /ic:"\<ati\>" new.ini I copied it but it didn't work!
Floor 10 Posted 2008-07-14 04:01 ·  中国 浙江 台州 临海市 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
I think I'm not careless but didn't understand! Still, please ask moderator lxmxn for guidance
Floor 11 Posted 2008-07-14 09:42 ·  中国 江苏 苏州 昆山市 电信
初级用户
Credits 26
Posts 13
Joined 2007-11-15 21:09
18-year member
UID 102773
Gender Male
From 江苏无锡
Status Offline
I also want to know the detailed information of this sentence, moderator, please explain it carefully.
Floor 12 Posted 2008-07-14 13:57 ·  中国 湖北 武汉 联通
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Oh, I was careless and missed a /r parameter. The correct one should be

findstr /irc:"\<ati\>" myfile.txt


That is, case-insensitive (/i), search for the regular expression pattern (/r) string (\<ati\>), where \< represents the start of a word and \> represents the end of a word.
Floor 13 Posted 2008-07-15 22:31 ·  中国 浙江 台州 临海市 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
Thanks, moderator lxmxn. The problem finally has a solution. I roughly understand the general idea, but I'm still a bit fuzzy about "what is the regular mode and the word boundaries".
Floor 14 Posted 2008-07-15 22:35 ·  中国 浙江 台州 临海市 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
Regular expressions are used to match fixed string formats.

For example, it is stipulated that in a string, it can only be numbers, only letters, or a combination of numbers, letters, and underscores (_). Even, there can only be 3 numbers followed by 2 letters, etc., which is very flexible. Does it mean that it can only be ATI and nothing else? I wonder if the understanding is correct?
Floor 15 Posted 2008-07-15 22:36 ·  中国 浙江 台州 临海市 电信
中级用户
★★
Credits 224
Posts 102
Joined 2007-11-09 00:19
18-year member
UID 102111
Gender Male
Status Offline
\<represents the front boundary of a word, and \> represents the back boundary of a word. As for this sentence, I can't understand it.
Forum Jump: