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

Re: [NTB] Counting string on disk?

Expand Messages
  • Dr. Paul Harder
    ... I m guessing that you mean that the string appears in the file names, not in the file contents. If that s true, then pop open a DOS window, cd into the
    Message 1 of 14 , Oct 20, 2001
    • 0 Attachment
      On Sat, 20 Oct 2001 19:15:56 +0200, David wrote:

      > I would like to count the number of times a certain string appears in
      > a certain directory without opening the files. (There are a lot of
      > them.) How do I do this?

      I'm guessing that you mean that the string appears in the file names,
      not in the file contents. If that's true, then pop open a DOS window,
      cd into the directory where your files are, then execute a command like
      this:

      dir > filenames.txt

      Then you can get rid of the DOS window and open filenames.txt in
      NoteTab. At this point, you can probably write a clip to count the
      occurrences of the string you're looking for. Personally, I wouldn't
      bother, because I've got the Cygwin UNIX shell emulator tools installed
      on my PC. At the DOS prompt, I'd enter this command:

      dir | grep search_string | wc -l

      where "search_string" is replaced by the string you're looking for.

      Regards,
      Paul


      ----------------------------------------------------------------------
      Dr. Paul Harder Houston, Texas, USA pharder@...
      ----------------------------------------------------------------------
    Your message has been successfully submitted and would be delivered to recipients shortly.