Page 1 of 1

Search for Folders which contain specific file

Posted: 02 Sep 2013 12:05
by karimmaster101
I want to search folders which contain "readme.txt", I want that search results page show me "Folders" not readme.txt files
thanks in advance

Re: Search for Folders which contain specific file

Posted: 02 Sep 2013 12:17
by admin
Copy Containing Folders can be used for this. See http://www.xyplorer.com/release_11.60.htm#v0200

Re: Search for Folders which contain specific file

Posted: 02 Sep 2013 12:28
by karimmaster101
admin wrote:Copy Containing Folders can be used for this. See http://www.xyplorer.com/release_11.60.htm#v0200
Thanks for your fast reply, But I don't want to copy folders, I want to list them so I can add labels or comments or batch rename them.
I think that this issue will be solved with a script. which list multiple paths like this
D:\movies\AB
D:\movies\AD
D:\movies\CC
But I don't know how I can do this

Re: Search for Folders which contain specific file

Posted: 06 Sep 2013 16:14
by totmad1
This script will, once you have selected all that you want after your search,
collect the names,write paths to temp.xys and write comment "ReadMe" to each folder.
You can of course then load from this script to visit any of those single folders,
or just delete temp.xys

Code: Select all

"1 Collect items : collect"
        $SelectedItemsPath= getinfo ("SelectedItemsPathNames", "|")."|";
        $CountSelectedItems= getinfo ("CountSelected");
         set $Items, $SelectedItemsPath;
         incr $Count, $Count, $CountSelectedItems;
                $T="";
               $i = 1;
                  while ($i <  $Count+1) {
                  $file=gettoken($SelectedItemsPath,$i,"|");
                    $q = getpathcomponent( "$file", "path");
                    $p = getpathcomponent( "$file", "file");
                     $file=$q . <crlf>;
                     $A= strpos("$file", "\", -1);
                    $Zfile = substr("$file", 0, $A);
                     $b = "ReadMe";                     // you can change comment here
                     tag "$b",$q , 2;
                    $Tfile = "; sel""[$q]"", ,1" ;
                   writefile("<xyscripts>\temp.xys", "No.$i $p" goto "$Zfile"$Tfile<crlf>,"a");
                   $i++;
                }  

"2.load "   load "<xyscripts>\temp.xys";
"3.Delete temp.xys"   delete 0, 0, "<xyscripts>\temp.xys";
hope this at least helps