|
-
Nov 5th, 2015, 09:04 AM
#1
[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
-
Nov 5th, 2015, 09:18 AM
#2
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)
-
Nov 5th, 2015, 09:36 AM
#3
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
Last edited by dilettante; Nov 5th, 2015 at 09:42 AM.
-
Nov 5th, 2015, 02:03 PM
#4
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!
-
Nov 5th, 2015, 02:50 PM
#5
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.
-
Nov 5th, 2015, 05:12 PM
#6
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|