Right-click and search for a string in a file?

Sharky Forums


Results 1 to 2 of 2

Thread: Right-click and search for a string in a file?

  1. #1
    Reef Shark
    Join Date
    Aug 2001
    Location
    Northern Kentucky
    Posts
    337

    Right-click and search for a string in a file?

    Hi all, I have some programs that spit out a .log file. I'm wanting to be able to right-click on a .log file and go to "Check for Errors" or something like that. I need a script that will check the file I right-click on and looks for "ERROR", "WARNING", and "uninit" strings in the file. I've found some programs that will do this, but A) they cost money, and B) they seem to only allow up to 2 search strings where I need at least these 3. Can anyone start me out on a script to do it, and then how I can pass the file name into it from the right-click? Thanks!

    Edit:
    I'm currently using "find "ERROR:" <filename> > <output file>" but everything is hardcoded. I also need 3 of these but want all listings to show up in one window.
    Last edited by ZF_NeAlvey; 10-26-2007 at 12:19 PM.

  2. #2
    Reef Shark
    Join Date
    Aug 2001
    Location
    Northern Kentucky
    Posts
    337
    Okay, possibly nevermind. I'm doing this:
    FINDSTR "ERROR WARNING uninit" %1
    pause


    and it's doing a pretty good job...any other suggestions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •