I want to get a list of all the lowest level folders or sub-folders (paths) that contain at least one file of a specified type e.g. all folders in C: that contain *.jpg files. I dont want a list of all the files but it would be nice to have a count of how many matching files there are in each listed folder.
What do you need to do with the list? Just see it or pass it to another program?
You can do it in a few ways. One is to do a normal Find on *.jpg (use the Find Panel in the Tools menu, not the Find Window) and then sort by the Location column. That may be enough on its own to see which folders contain files, if there aren't many files in each folder.
If the folders contain a lot of files, you could select all the files and then run this command:
go opencontainer NEWTAB=findexisting
That will open one tab for each of the folders that contains some of the files.
Alternatively, you could switch into Flat View mode and filter on *.jpg and then see which folders have files below them. That will only work well with small amounts of files/folders, though.
If you need the list of folders in a text file for some reason then you could use the Find *.jpg method, then select all the files and run this command:
Clipboard COPYNAMES REGEXP "(.*)\\[^\]+" "\1"
That'll give you a list of all the paths. If a path contains more than one file then it'll appear in the list more than once, but you can use a text editor to clean that up. (e.g. TextPad's Sort function has an option to remove duplicate lines.)