Find only files in (certain) subdirs ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
SL09
Posts: 48
Joined: 13 Jun 2009 13:54

Find only files in (certain) subdirs ?

Post by SL09 »

I would like to find ONLY the files in Subdirs D:\Example1\_, D:\Example7\_, D:\Example15\_, ...
NOT the ones in the Dirs D:\Example1\, D:\Example7\, D:\Example15\
without naming / selecting them all - there are many :D

('include subdirs' shows all files ...)
Is there some logic hidden in the Search dialog ? or would this need some scripting (which is alway complicated) ?

highend
Posts: 14245
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Find only files in (certain) subdirs ?

Post by highend »

Code: Select all

    $result = quicksearch("/f", <curpath>, , "s");

    // Remove all found files inside the first level subfolders of <curpath>
    // E.g.:
    // <curpath> = D:\!tests
    // D:\!tests\Example1\a.txt   => Remove
    // D:\!tests\Example1\_\a.txt => Keep
    $escaped = regexreplace(<curpath>, "([\\^$.+()\[{])", "\$1");
    $pattern = $escaped . "\\[^\\]+?\\[^\\]+?(\r?\n|$)";
    $result  = regexreplace($result, $pattern);
    paperfolder("Search result", $result);
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 63615
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Find only files in (certain) subdirs ?

Post by admin »

By the way: I did not like the commas in the old Poppins font; they looked like dots. Also, the slashes were too wide.
So I made it like the main website font (which is 'Open Sans' 17px), but use "em" for the font size, which comes out *slightly* different and better here (more consistent line height).
So: Poppins 1.2em --> Open Sans 1.4em

Before:
XYForumPost-Font-Poppins-1.2em.png
XYForumPost-Font-Poppins-1.2em.png (19.64 KiB) Viewed 454 times
After:
XYForumPost-Font-OpenSans-1.4em.png
XYForumPost-Font-OpenSans-1.4em.png (19.05 KiB) Viewed 454 times

Post Reply