Seach files for empty text documents

Seach files for empty text documents

3
NewbieNewbie
3

    Dec 04, 2006#1

    How can I use UltraEdit to search a directory for files that contain NO text (or that contain only a few characters)?

    Idealy I would like to develop a word/character count for each file in a directory.

    6,602548
    Grand MasterGrand Master
    6,602548

      Dec 04, 2006#2

      UltraEdit is a text editor and not a file manager. To search for files with less than xx bytes use Windows Explorer or Total Commander.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Dec 04, 2006#3

        Thanks for the tip. Document size alone, however, doesn't help me.

        The reason I need a text editor it to search large directories of text files and identify those with no text. Some may have only line breaks and spaces and be well over 1KB in size but contain no text.

        6,602548
        Grand MasterGrand Master
        6,602548

          Dec 05, 2006#4

          Well, Total Commander has very good search capabilities. With TC you can search for files with size less than xx bytes and does NOT contain a specified text. The specified text can be also a Perl regular expression. So with Total Commander you will easily get the list of files you want.

          To do this with UltraEdit needs much of work.

          First you must get a list of all files in your directories. This can be done since UE v9.10 with a Find In Files with an empty search string with results to an edit window.

          Next you have to run on same files a regular expression search to find the files which contain words with at least x characters. This is also a Find In Files search with results to an edit window. From this result you have to delete everything except the file names with full path and sort the file with removing duplicate file names because a word is surely found more than once in a file. I have posted already a macro which does this job - macro depends on your version of UltraEdit.

          Now you have 2 lists with file names: First list contains all files and second list contains all files with at least 1 word (or more - depends on your macro which evaluates the search result) which has at least x characters.

          You can now remove with a macro all file names from list 2 in the list of file 1 and the result should be a list of files which does not have (enough) words.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Dec 06, 2006#5

            Thanks to Mofi for the new toy! (I mean tool...)

            I can use Total Commander to search for text NOT in the file, search for [0-9a-z] using RegEx, giving me a list of all documents with out meaningful text, which is exactly what I want.