Sort search results on search order

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
user268745
Junior Member
Junior Member
Posts: 4
Joined: 2022-06-05, 09:33 UTC

Sort search results on search order

Post by *user268745 »

Is it possible to search for multiple files and sort them based on the search order instead of filename?

Example:

In the search field I enter: *0001.pdf* *0004.pdf* *0003.pdf* *0002.pdf*

The results in the list are:
0001.pdf
0002.pdf
0003.pdf
0004.pdf

What I want is:
0001.pdf
0004.pdf
0003.pdf
0002.pdf

Is this possible?
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Sort search results on search order

Post by *Dalai »

This would only be possible if you can find something that supports the search order you want, like Size, Date, or some metadata from the PDFs themselves (via xPDFSearch for example). Once you have such criteria you can put them in a custom column.

Since NTFS sorts by names by default, even "Unsorted" sort order probably doesn't help in this case.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
white
Power Member
Power Member
Posts: 4595
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Sort search results on search order

Post by *white »

  • Use Unsorted sort order
  • Put the search in a list file and put each search on a separate line
  • Search using list file (@c:\path\filelist.txt) in the "Search in" field.
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Sort search results on search order

Post by *tuska »

In addition to what was said before, one can also solve this, for example, as follows.
Path, files and listfiles
  1. Path and files

    Code: Select all

    D:\Test\pdf\0001.pdf
    D:\Test\pdf\0002.pdf
    D:\Test\pdf\0003.pdf
    D:\Test\pdf\0004.pdf
    
  2. PDF_unsorted_with-path.txt

    Code: Select all

    D:\Test\pdf\0001.pdf
    D:\Test\pdf\0004.pdf
    D:\Test\pdf\0003.pdf
    D:\Test\pdf\0002.pdf
    
  3. PDF_unsorted_without-path.txt

    Code: Select all

    0001.pdf
    0004.pdf
    0003.pdf
    0002.pdf
    
  1. View mode
    Configuration -> Options... -> View mode -> Add... Unsorted -> press Button "OK"
    Sort order: Unsorted ...
     
  2. Auto Switch Mode
    [] Automatically switch view mode on directory change
    Add... Rule: S: Search result
    Set this mode: Unsorted  <= NameOfYourViewMode, press Button "OK"
    Note: If there is already another rule with S: Search result, then the last rule entered must be moved up with the up arrow key,
    as the rules are processed from top to bottom.
Perform a search under using file "PDF_unsorted_with-path.txt"
  1. Search in separate process... Alt+Shift+F7
  2. Search in: @D:\Daten\PDF_unsorted_with-path.txt
    Note:
    Since the path was saved in the file "PDF_unsorted_with-path.txt", it does not matter where this file is located (e.g. D:\Daten\).
  3. Press button "Start search" (the desired sorting is not yet available)
  4. Press button "Feed to listbox" (the desired sorting was produced due to the View mode with Auto Switch Mode)

    Code: Select all

    D:\Test\pdf\0001.pdf
    D:\Test\pdf\0004.pdf
    D:\Test\pdf\0003.pdf
    D:\Test\pdf\0002.pdf
    
  5. Reread Source Ctrl+R ... restores the previous view.
Perform a search under using file "PDF_unsorted_without-path.txt"
The search is carried out in the same way as described above.
Note:
Since the file "PDF_unsorted_without-path.txt" contains only the file names and no paths,
this .txt file must be located in the same folder as the .pdf files.
In this example, this is the folder "D:\Test\pdf\".


Windows 11 Pro (x64) Version 21H2 (OS build 22000.832) | TC 10.50 x64/x86
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Sort search results on search order

Post by *petermad »

2user268745
The search result lists the files (not the directories) in the same order as the file panel is sorted before starting the search.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply