Page 2 of 2

Re: How to Show Folders within a Tree without Parents or Subfolders with a Regexp

Posted: 15 Aug 2018 12:17
by highend
So you want to see only folders that contain files (but not the files itself)...

Code: Select all

    $path = <curpath>;
    $files = quicksearch("/f", $path);
    $folders = regexreplace($files, "[^\\]*?(?=\r?\n|$)");
    $folders = formatlist($folders, "de", <crlf>);
    paperfolder("Folders_with_Files", $folders);
You need to add the path column to the paperfolder view, so that displayed subfolders get their real context, though...

Re: How to Show Folders within a Tree without Parents or Subfolders with a Regexp

Posted: 15 Aug 2018 12:49
by pdupreez
highend wrote:So you want to see only folders that contain files (but not the files itself)...

Code: Select all

    $path = <curpath>;
    $files = quicksearch("/f", $path);
    $folders = regexreplace($files, "[^\\]*?(?=\r?\n|$)");
    $folders = formatlist($folders, "de", <crlf>);
    paperfolder("Folders_with_Files", $folders);
You need to add the path column to the paperfolder view, so that displayed subfolders get their real context, though...
Thanks, learned about PaperFolders too....
I ended up with this:

Code: Select all

    
    $path = "N:\RoughTagged\";
    $files = quicksearch("/f", $path);
    $folders = regexreplace($files, "[^\\]*?(?=\r?\n|$)");
    $folders = formatlist($folders, "de", <crlf>);
    paperfolder("FoldersWithoutSubfolders", $folders);
    
That however goes down to the nth level of all the folders in current path, and give me those folders as output, like such

Current:/Folder1/Sub 1/Sub 2/Files
Current:/Folder2/Sub 1/Sub 2/Files
Current:/Folder3/Files

and gives me in PaperFolder

Current:/Folder1/Sub 1/Sub 2/
Current:/Folder2/Sub 1/Sub 2/
Current:/Folder3/

instead of only

Current:/Folder3/

as per screenshot Image

Re: How to Show Folders within a Tree without Parents or Subfolders with a Regexp

Posted: 15 Aug 2018 12:52
by jupe
With your example above if you are positioned in this path, "Drive:/Current Dir/" and used this in the XY address bar:

Code: Select all

<curpath>?/md=1 /dx
it should do what you want too, if I am understanding correctly.

Re: How to Show Folders within a Tree without Parents or Subfolders with a Regexp

Posted: 15 Aug 2018 12:56
by highend
So why don't you say that in the first place, that the scan depth needs a limitation?

So you could also follow jupes advice and do it like this (because it seems you don't want to use <curpath> but a fixed one):

Code: Select all

goto "N:\RoughTagged\?/md=1 /dx";

Re: How to Show Folders within a Tree without Parents or Subfolders with a Regexp

Posted: 15 Aug 2018 12:59
by pdupreez
jupe wrote:With your example above if you are positioned in this path, "Drive:/Current Dir/" and used this in the XY address bar:

Code: Select all

<curpath>?/md=1 /dx
it should do what you want too, if I am understanding correctly.
Wow, that is awesome. Found 547 folders in a flash.

Now if I only know what it means (My problem, I will go and read up). Thanks to you and highend

Thanks a lot

Re: How to Show Folders within a Tree without Parents or Subfolders with a Regexp

Posted: 15 Aug 2018 13:15
by pdupreez
pdupreez wrote:
jupe wrote:With your example above if you are positioned in this path, "Drive:/Current Dir/" and used this in the XY address bar:

Code: Select all

<curpath>?/md=1 /dx
it should do what you want too, if I am understanding correctly.
Wow, that is awesome. Found 547 folders in a flash.

Now if I only know what it means (My problem, I will go and read up). Thanks to you and highend

Thanks a lot
For posterity, the code can be well understood through the help file. In any case, I understood it as follow:

<curpath> Work on Current Path
? Search
/md=1 Maximum Depth of search
/d Only find Folders
x switch to only return folders that don't contain any matching items

Very neat