Excluding files in a Search

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Mango
    Indigo Rose Customer
    • Jan 2007
    • 49

    Excluding files in a Search

    Is there any way to exclude a certain folder in search?

    Let's say I have a folder full of Word docs, but want to search the entire C drive for any other Word Docs but excluding that folder, and then show the full paths to any that are found.

    I can do a complete File.Find and create the results showing full paths in a Dialog.Message box, but just can't work out how to exclude that 1 particular folder.

    Anybody have any ideas please?
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

    #2
    A couple ways you could do that:
    • perform the full search, and then remove any paths from the results that contain the path to the folder
    • instead of searching all of C:, use Folder.Find to get a list of all folders that exist. Remove any folders from the results that contain the path to the folder you want to omit. Then, search through the remaining folders, one at a time.


    You can figure out the details by reading the help file.
    --[[ Indigo Rose Software Developer ]]

    Comment

    • Mango
      Indigo Rose Customer
      • Jan 2007
      • 49

      #3
      Thanks for the reply Lorne, and I understand what you're advising, however that's where I have the problem because the help file isn't helping. The results of a Search are held in a table, but the help file doesn't show any ways of removing data from that table.

      Comment

      • Lorne
        Indigo Rose Staff Member
        • Feb 2001
        • 2729

        #4
        There are a few ways you can do it.

        You could copy the "good" folders from that table into another table.

        If it's a numerically-indexed table, you can use the Table.Remove action to remove an element by its index.

        Or you could just skip over the "bad" folders in the loop where you actually perform the file search in each of those folders.
        --[[ Indigo Rose Software Developer ]]

        Comment

        • Mango
          Indigo Rose Customer
          • Jan 2007
          • 49

          #5
          Hi Lorne

          As I'm a bit green using Tables, can you advise how I can use the Table.Remove feature to remove the folder that is not required.
          The original table created is indexed by number, but the numbers (index) to delete would be different on each persons PC.
          Also, as I'm search by *.doc, there could be any amount of files found on different PC's in the same named folder.

          Comment

          Working...
          X