16823Re: [Clip] Extract file names from Disk search to new doc
- Jul 31, 2007Perhaps I'm missing something, but if you go to the command prompt, and type in for example:
findstr "searchtext" *.txt > foundThese.txt
all files with txt extension will be searched for the searchtext, and all filenames in which it is found will be sent to the file foundthese.txt which, when opened, lists the filenames and context of the found text.
If you want to search the current directory and all subdirectories use a /s toggle like this
findstr /s "searchtext" *.txt > foundThese.txt
You put whatever you want for the searched text ( e.g. "searchtext"),
what files do you want to search (e.g.*.txt)
and the file you want the output stored (e.g. foundThese.txt)
The > symbol redirects the search results into the file specified(it creates the file, puts the output in it and closes it automatically)
It's done in a wink.
Perl can do it in one line also, but the command prompt is available to everybody, whereas not everyone has Perl.
Hugo Paulissen <hugopaulissen@...> wrote:
> It was also suggested that WindowsSEARCH in
> search/find be used , but that takes a full day to run ONCE on my
> computer, I have a 1 gig SDRam, running Vista Home. and the
> windows is slower than molasses at 35 below.fast in
> The NoteTab Disc search (With screen update OFF) is incredibly
> Using windows to do it under their system is worse than looking
More then five years ago I tried to call findstr to work on my (then
new) XP-system, I advised Jody to look into this option, and never
used it myself.
I do not know if Vista still has the findstr-option, but it could be
that the following clip may be a starting point. I do think that it
is fast enough, but you are the only one to judge that...
The following is based on the example I once sent to the scriptlist.
I do not have too much time for clips nowadays. I've removed the
negate part of the find in this example (you could find files with
certain words and exclude all files with other words).
^!GoTo ^?[What do you want to do?==Get help on
^!Set %find%=^?[Find=string of characters]
^!Set %where%=^?[(T=D)Where?=C:\Documents and Settings]
^!Set %found%=^$GetDosOutput("findstr /S /M /C:"^%find%" "^%where%*^%
^!IfTrue ^$IsEmpty(^%found%)$ NOTFOUND
^!Save AS list^%find%.txt
^!INFO As you have noticed, ^%find% could not be found...
Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>