Results 1 to 6 of 6

Thread: [RESOLVED] Looking for: A text file scanner...

  1. #1

    Thread Starter
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Resolved [RESOLVED] Looking for: A text file scanner...

    I'm looking for a tool that I can point at a folder, and have it scan all files in that folder looking for a piece of text. Windows is great (great being a relative term) at giving me files with NAMES of a given pattern, but I'm looking for something that will tell me when the piece of text is IN a file.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Looking for: A text file scanner...

    Notepad++ has exactly what you're looking for.


    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Looking for: A text file scanner...

    I had the idea that this sort of "desktop search" tool died out when Vista came out with a powerful Windows Search. This meant that the Explorer Search Bar could accept most such queries, Advanced Search added more capabiities, and programs could use the Windows Search facility via ADO.

    Code:
    CN.Open "Provider=Search.CollatorDSO;Extended Properties='Application=Windows'"
    See Querying the Index with Windows Search SQL Syntax

    Name:  sshot.jpg
Views: 159
Size:  32.9 KB
    Last edited by dilettante; Nov 5th, 2015 at 09:42 AM.

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,397

    Re: Looking for: A text file scanner...

    @Bonnie West - I've used Notepad++ for some time now and I've never seen that option. That is awesome!
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: Looking for: A text file scanner...

    Well, on my work computer I can't install niceties like Notepad++, and for whatever reason I guess I don't know how to do the Explorer search correctly because if I go to my default VB.Net Projects directory and so a search for "stopwatch", it only returns a couple of .txt files, and some .zip files which I'm assuming have copies of those same .txt files that the search found.

    So, I still usually revert to my old 1980's DOS days and do the (assuming Win7 here) <Shift-RightClick> on a directory and select Open Command Prompt to open a command prompt on the directory I want to search, and use findstr, which is quite a bit slower I'm sure, but usually does the job I want.
    Code:
    C:\Users\passel\Documents\Visual Studio 2010\Projects>findstr /s /I "stopwatch" *.vb
    AsteroidAvoid\AsteroidAvoid\Module1.vb:    Dim s As New Stopwatch
    BufferedGraphicGenericClassTest_brush\BufferedGraphicGenericClassTest\GenBufferedGraphics.vb:    Dim sw As New Stopwatch
    BufferedGraphicsExample1\Form1.vb:  Private sw As New Stopwatch
    BufferedGraphicsExample1\Form1.vb:    Me.Text = Stopwatch.Frequency.ToString
    BufferedGraphicsExample1\Form1.vb:    Dim seconds = deltaTicks / Stopwatch.Frequency
    BufferedGraphicsExample2\Form1.vb:  Private sw As New Stopwatch
    BufferedGraphicsExample2\Form1.vb:    Me.Text = Stopwatch.Frequency.ToString
    BufferedGraphicsExample2\Form1.vb:    Dim lelm As Long = sw.ElapsedTicks - (Stopwatch.Frequency \ 60)
    BufferedGraphicsExample2\Form1.vb:      fps = CInt(Stopwatch.Frequency / (elm - lelm))
    BufferedGraphicsExample2\Form1.vb:    Dim seconds As Double = deltaTicks / Stopwatch.Frequency
    ... and so on
    Could use a single * to search all files regardless of file type.

  6. #6

    Thread Starter
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Looking for: A text file scanner...

    Actually teh N++ option ended up working best for what I needed... pretty sweet. I've been usung N++ for a number of years and never knew about it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

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



Click Here to Expand Forum to Full Width