Page 1 of 3

Folder name search

Posted: Tue Apr 16, 2019 11:46 pm
by Rhea
Hello there,
I was trying to use the search function to find some folders until I realized... it's only for files? Or do I miss something? Thought it would come handy for handling the whole folder collection but I was wrong I guess 8)

Is this a planned function? Found some others threads a few years old, which describe the same problem.. :(

-Rhea-

Re: Folder name search

Posted: Wed Apr 17, 2019 7:26 am
by xnview
yes it's planned

Re: Folder name search

Posted: Wed Jan 08, 2020 5:04 am
by Rhea
Any news on the function?

Re: Folder name search

Posted: Fri Aug 26, 2022 9:03 am
by aticus
Hi!

Any news on the function?

Re: Folder name search

Posted: Fri Aug 26, 2022 9:46 am
by michel038
Since V0. 96 1, "Pathname" Is available in the search function, with some different operators ( is, is not, contains, ...)

I think that "Use catalog" option will increase search speed

Re: Folder name search

Posted: Sat Aug 27, 2022 9:24 am
by helmut
In XnView MP 1.02 I've just tried out searching for folders with a specific name. From what I can see the current search for "Pathname" is a start but the way it works it's not suitable for searching for folders.

Preparation/Note:
For searching for folders you have to activate "Recurse through subfolders". If you don't activate this checkbox the whole search doesn't make sense because current folder will be searched, only.

Some problems that I see:
  • If you specify "Programs" as pathname, nothing will be found unless you change the comparator "is" to comparator "contains". Reason is that the full pathname is compared with your search text and "C:\Programs" doesn't equal to "Programs". But then, not only "Programs" folder is found but all subfolders are found, too, because they also contain "Programs" (e.g. "C:\Programs\XnView").
  • If you search for folders with a specific name "PDF", folders with this name will be found but also folders including files containing "PDF" (e.g. "C:\Programs\java\PDFconstants.java").
  • If you search for folders with a specific name (e.g. "PDF"), all folders with this name and all subfolders will be listed.
  • If add a backslash to your search name (e.g. "\PDF") nothing will be found.

Summary
Above I've listed just some problems/limitations of the search criteria "Pathname" that I see - I guess there are many more. Search criteria "Pathname" makes sense for including and excluding specific paths but for searching for folders with specific names it's useless.

My suggestions:
  • Add a search option "Folder" that searches for folders with that specific name.
  • Make search criteria "Pathname" search the path without filename (not: path with filename)

Re: Folder name search

Posted: Sun Aug 28, 2022 6:03 pm
by michel038
I'm waiting to hear if Pierre can develop Helmut's excellent suggestions, otherwise I can offer a workaround with BAT files for Windows.


It's a bit tricky , something like :

1) create a TXT file containing the list of your directories :
cmd
Dir /ad /b /s > C:\XNVIEWMP\DirList.txt
(You will need to renew this file when folders are added)

2) create a BAT file searching for a <word> in this list
@echo off
:aa
set /p word= Enter a word to search
find /i "%word%" "C:\XNVIEWMP\DirList.txt"
goto aa

3) Add a shortcut in your toolbar linked to the bat file ...

Re: Folder name search

Posted: Sun Aug 28, 2022 8:46 pm
by helmut
michel038 wrote: Sun Aug 28, 2022 6:03 pm I'm waiting to hear if Pierre can develop Helmut's excellent suggestions, otherwise I can offer a workaround with BAT files for Windows.
Your batch script (BAT file) is a good thing, thanks for sharing it, Michel. Just to make sure: My "excellent suggestions" above will help to allow for adding "Folder" as search criteria but even with these changes XnView's search will remain a search for files and not a search for folders. A search for folders is something completely different and would require several changes to the current dialog, I think.

Perhaps, Windows Explorer can also be used for searching folders with specific names:
MS Explorer allows for searching elemtents including folders, filenames. I'm not 100% sure but I think it should be possible to search for folders, only. Following webpage offers lots of infos (which I haven't read, yet): https://www.informit.com/articles/artic ... &seqNum=16
I've tried "abc type:=folder" to find folders, only, but this search finds files with "abc", too. Perhaps someone else can help here.

Re: Folder name search

Posted: Tue Sep 27, 2022 1:26 pm
by michel038
I tried a new method :
I added a category ("Folder") on all my folders.
In categories filter, when "Folder" is selected, all folders are shown. With "Quick search", I can instantly find any word I'm looking for in folder names ...
And double click on the result to browse it .

In addition, a "Description" can be added to each folder (Right click, Edit Comment or Ctrl D) , use descript.ion file and not embedded comment.
Trick to be quicker
- Create a description with a single character "x" for all selected folders (in the parent folder)
- Edit the decript.ion hidden file with a notepad, and add some words for each folder, instead of "x"
Then the quick search will instantly find searched folders containing some strings in their name and in their description.

Re: Folder name search

Posted: Wed Oct 04, 2023 6:44 pm
by FKCapitalism2
xnview wrote: Wed Apr 17, 2019 7:26 amyes it's planned
Hope you can implement this sooner than later, lack of this functionality really holds me back right now.

michel038 wrote: Tue Sep 27, 2022 1:26 pm I tried a new method :
I added a category ("Folder") on all my folders.
In categories filter, when "Folder" is selected, all folders are shown. With "Quick search", I can instantly find any word I'm looking for in folder names ...
And double click on the result to browse it .

In addition, a "Description" can be added to each folder (Right click, Edit Comment or Ctrl D) , use descript.ion file and not embedded comment.
Trick to be quicker
- Create a description with a single character "x" for all selected folders (in the parent folder)
- Edit the decript.ion hidden file with a notepad, and add some words for each folder, instead of "x"
Then the quick search will instantly find searched folders containing some strings in their name and in their description.
Unfortunately this method would require to first locate every single folder before assigning it a category which is what i wanted to avoid in first place.

Re: Folder name search

Posted: Wed Oct 04, 2023 8:49 pm
by michel038
Search on paths is case sensitive although this option is not enabled (this option only applies to the filenames)

Right, "Search" is intended to find files ...
When a word matches a part of a pathname , all file names that are in that folder will be shown.
But if the folder is empty, it won't be shown

Test in a cmd window :

Code: Select all

Dir D:\Photos /s /ad /b | find /i "washington"
will show all subfolder names of D:\photos containing Washington

Using a .bat file:

Code: Select all

@echo off
:aaa
set /p word="String to search : "
if "z%word%"=="z" goto bbb
Dir D:\Photos /s /ad /b | find /i "%word%"
goto aaa
:bbb
then you can add a new button in the toolbar, linked to this bat file ...
but in this way, we cannot mix searches with other criteria. :x

Re: Folder name search

Posted: Thu Oct 05, 2023 6:45 am
by FKCapitalism2
michel038 wrote: Wed Oct 04, 2023 8:49 pmthen you can add a new button in the toolbar, linked to this bat file ...
Is that right way to do it?

Image

After doing this i get CMD window with list of folder, they not display in XnViewMP interface thus thumbnails don't get loaded for them.
Image

Re: Folder name search

Posted: Sat Oct 07, 2023 4:54 am
by FKCapitalism2
michel038 wrote: Wed Oct 04, 2023 8:49 pmthen you can add a new button in the toolbar, linked to this bat file ...
Could you provide more information please.

Re: Folder name search

Posted: Sat Oct 07, 2023 7:02 am
by michel038
Yes, sorry... If you have got the result in the CMD window, it's the right method.
We can't get a best result with this method.
I thought you were looking for some folders, lost somewhere in the file's tree. (I'm naming my folders with some words that can describe the place, the event or the content. It's helpful to find a photo with incomplete memories)
In cmd environment, you can redirect the result to a text file by adding >file.txt at the end of the command.
Don't know if this can help.
Dir D:\Photos /s /ad /b | find /i "%word%" > C:\doc\result1.txt

I'll be back in about 10 days...

Re: Folder name search

Posted: Sat Oct 07, 2023 7:44 am
by user0
there is free, portable app in active development that search instantaneously:
Everything from voidtools.com

you can set it up to filter results by type, eg folder, images.. etc.