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

    From Chris Roberts@21:1/5 to All on Thu May 6 10:59:35 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu May 6 20:53:16 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to Chris Roberts on Fri May 7 18:50:46 2021
    On Thu, 6 May 2021 10:59:35 -0700 (PDT), Chris Roberts wrote:
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)