Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do you search for a literal "!" within findstr command using DOS

27 views
Skip to first unread message

Chris Roberts

unread,
May 6, 2021, 1:59:36 PM5/6/21
to
How do you search for a literal "!" within findstr command using DOS
Can it even be done?

for instance I want to see all the lines in a file that have a "!" in them.
$ findstr -i "\!" file.txt
!(Nope nothing)
Does anyone have any ideas?

Thanks,
Crzzy1

R.Wieser

unread,
May 6, 2021, 2:53:36 PM5/6/21
to
Chris,

> How do you search for a literal "!" within findstr command using DOS
...
> $ findstr -i "\!" file.txt

On my version of Windows (DOS doesn't have a "findstr" command or program) ?
Exactly like that.

Well, without that "$ " prefix (no idea what its for or from). And I'm not
sure why you included that "-i", or enclosed that "\!" in double-quotes

Here the minimal working command is :

findstr \! file.text

Regards,
Rudy Wieser


JJ

unread,
May 7, 2021, 7:50:51 AM5/7/21
to
Is the text file actually has the `!` character, and not the Unicode
characters which look like `!`?

If you're using WINE in Linux, IIRC, you'll have to type the full (EXE) file
name including its extension.
0 new messages