Discussion:
How do you search for a literal "!" within findstr command using DOS
(too old to reply)
Chris Roberts
2021-05-06 17:59:35 UTC
Permalink
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
2021-05-06 18:53:16 UTC
Permalink
Chris,
Post by Chris Roberts
How do you search for a literal "!" within findstr command using DOS
...
Post by Chris Roberts
$ 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
2021-05-07 11:50:46 UTC
Permalink
Post by Chris Roberts
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?
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.

Loading...