Loading ...
Sorry, an error occurred while loading the content.

16823Re: [Clip] Extract file names from Disk search to new doc

Expand Messages
  • Jane Sedgewick
    Jul 31, 2007
      Perhaps 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 Windows
      > 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
      SEARCH in
      > windows is slower than molasses at 35 below.
      > The NoteTab Disc search (With screen update OFF) is incredibly
      fast in
      > comparison.
      > 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).

      ^!Menu File/New
      ^!GoTo ^?[What do you want to do?==Get help on
      ^$GetOutput("findstr /?")$
      ^!GoTo EXIT
      ^!Set %find%=^?[Find=string of characters]
      ^!Set %where%=^?[(T=D)Where?=C:\Documents and Settings]
      ^!Set %ext%=.^?[Extension=_txt|htm|html]
      ^!Set %found%=^$GetDosOutput("findstr /S /M /C:"^%find%" "^%where%*^%
      ^!IfTrue ^$IsEmpty(^%found%)$ NOTFOUND
      ^!Save AS list^%find%.txt
      ^!Goto END
      ^!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]
    • Show all 31 messages in this topic