Sorting: Ignore first 7 characters And sort

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
cadillac
Posts: 14
Joined: Sat Aug 27, 2011 6:44 am

Sorting: Ignore first 7 characters And sort

Post by cadillac »

Hi,

I have files like this:

2015 - book1
1999 - book2
1989 - book3

Can I configure Everything to ignore the year of the book. And sort the than? So that I have the titles in alphabetical form.

Thank you in anticipation!

ps
I do not want to rename the files and directories. I need the sortig via year too.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Sorting: Ignore first 7 characters And sort

Post by Stamimail »

Advanced sort?
I don't think this is possible.
But I'm thinking about some solutions like:
1. EFU Everything File List (*.efu)
2. Editing dates of files
3. Double files (shortcuts/hardlinks with other filenames)
4. Tags
void
Developer
Posts: 15365
Joined: Fri Oct 16, 2009 11:31 pm

Re: Sorting: Ignore first 7 characters And sort

Post by void »

Currently, this can't be done easily, sorry.

You could try creating a file list of the filenames and stripping the first 7 characters.
However, once the file list is opened, the filenames will not reference the real files.

Sorting by the first regex match would be really useful here.. Added to my TODO list.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Sorting: Ignore first 7 characters And sort

Post by Stamimail »

Is the Advanced Rename feature of Everything can help here?
cadillac
Posts: 14
Joined: Sat Aug 27, 2011 6:44 am

Re: Sorting: Ignore first 7 characters And sort

Post by cadillac »

Thx for that discussion for solution!

@void
For what should I look for to know that that feature is intigrated?

a) will you post it here?
b) or what will be the name to search for in each update you release?
NotNull
Posts: 5261
Joined: Wed May 24, 2017 9:22 pm

Re: Sorting: Ignore first 7 characters And sort

Post by NotNull »

I'm not @void, but I "follow" what's going on in this thread: viewtopic.php?f=2&t=5718
Here all fixes and new functonality is posted.

BTW: If you want just a list of all your books, sorted like you want it to, that is certainly possible. LEt me know if you're interested in that.
cadillac
Posts: 14
Joined: Sat Aug 27, 2011 6:44 am

Re: Sorting: Ignore first 7 characters And sort

Post by cadillac »

BTW: If you want just a list of all your books, sorted like you want it to, that is certainly possible. LEt me know if you're interested in that.
Yes please, go on!
NotNull
Posts: 5261
Joined: Wed May 24, 2017 9:22 pm

Re: Sorting: Ignore first 7 characters And sort

Post by NotNull »

  • First step is to write a search command in Everything so you find all your books.
    Let's say your search query is:

    Code: Select all

    c:\MyBooks ext:txt
    
    (Probably more along the lines of c:\MyBooks ext:mobi;pub regex:^^[0-9]{4}" - ".* , but it's an example)
  • Now download Everything Command-line Interface (current version of ES is 1.1.0.9) from http://www.voidtools.com/downloads/
  • Extract this zip to some folder on your harddisk
  • Start CMD and go to this folder (CD /d "c:\My Folder" ,or whatever your folder is)
  • Execute this command:

    Code: Select all

    ES.exe -name c:\MyBooks ext:txt | SORT.exe /+7 /output MyBookList.txt
    
    Replace c:\MyBooks ext:txt with the searchquery youy used earlier.
  • In MyBookList.txt are your books, sorted from the 7th character (ie the first 6 characters are ignored for the sorting)
MAybe you also want to get rid of the .txt in "2015 - book1.txt"?

EDIT: Just tested. This is my output, based on your (demo) books:

Code: Select all

2015 - book1.txt
1999 - book2.txt
1989 - book3.txt
Last edited by NotNull on Thu Jan 30, 2020 4:41 pm, edited 1 time in total.
cadillac
Posts: 14
Joined: Sat Aug 27, 2011 6:44 am

Re: Sorting: Ignore first 7 characters And sort

Post by cadillac »

Thak you! I am not home.

I will tell you my progress when I have time to test it. Good Evening
NotNull
Posts: 5261
Joined: Wed May 24, 2017 9:22 pm

Re: Sorting: Ignore first 7 characters And sort

Post by NotNull »

cadillac wrote:I will tell you my progress when I have time to test it. Good Evening
You must be a very busy man/woman!! ;-)
cadillac
Posts: 14
Joined: Sat Aug 27, 2011 6:44 am

Re: Sorting: Ignore first 7 characters And sort

Post by cadillac »

Sorry I forgot to give feedback.

It works good, thank you!

ps
But I would need much more the feature we discussed here in this thread.
void
Developer
Posts: 15365
Joined: Fri Oct 16, 2009 11:31 pm

Re: Sorting: Ignore first 7 characters And sort

Post by void »

Everything 1.5 Alpha adds support for a regex match 1 property.

Results can be sorted by regex match 1.

To sort by book name, instead of year:
  • In Everything 1.5 Alpha, type in the following search:
    c:\MyBooks ext:mobi;pub regex:"^[0-9]{4} - (.*)$"
  • Right click the result list column header and check Search -> Regular Expression Match 1
  • Sort results by this new column.
therube
Posts: 4610
Joined: Thu Sep 03, 2009 6:48 pm

Re: Sorting: Ignore first 7 characters And sort

Post by therube »

So I was messing with this...

(One of my normal columns is (video) 'Length'.
And as I'm messing with this, it added, 'Regular Expression Match 1' to the right of the Length column (& that is fine).

But... at that point in time, Length details, lazyload as they are (for me), were irrelevant, & I could have done with that data loading. [Which brings me back to, RFE: Disable Updates of Lazy Load Column.]

Just mentioning, cause, well, I ran into that specific situation.)

---

RFE:

Oh, perhaps, for the column name, abbreviate that to something like: RexEx 1...
As it is 'Regular Expression Match 1' is rather wordy & long, & the match # likely, well in my case, is truncated (overflow) as it is.
RexEx 1 is short & sweet & conveys the expected meaning.
void
Developer
Posts: 15365
Joined: Fri Oct 16, 2009 11:31 pm

Re: Sorting: Ignore first 7 characters And sort

Post by void »

I will consider an option to pause the loading of properties.

I will consider using abbreviated header titles when the header width is short.
Header tooltips are on my TODO list.
Use localization_strings to set the header text to anything you like (not ideal, but does give the user full control).

For example:
localization_strings=Regular Expression Match 1=Regex1

Thank you for the suggestions.
jimspoon
Posts: 161
Joined: Tue Apr 26, 2011 11:39 pm

Re: Sorting: Ignore first 7 characters And sort

Post by jimspoon »

void wrote: Sat Jun 19, 2021 4:58 am Everything 1.5 Alpha adds support for a regex match 1 property.

Results can be sorted by regex match 1.

To sort by book name, instead of year:
  • In Everything 1.5 Alpha, type in the following search:
    c:\MyBooks ext:mobi;pub regex:"^[0-9]{4} - (.*)$"
  • Right click the result list column header and check Search -> Regular Expression Match 1
  • Sort results by this new column.
Would it be possible to use a regex search to define a new property consisting of text extracted from a filename or another property? Using the above example - you might define the property "Book:" with the associated search "c:\MyBooks ext:mobi;pub regex:"^[0-9]{4} - (.*)$"" Then you could do a search like "book:potter" if you wanted to find a Harry Potter book. You could have a whole list of property definitions defined this way.
void
Developer
Posts: 15365
Joined: Fri Oct 16, 2009 11:31 pm

Re: Sorting: Ignore first 7 characters And sort

Post by void »

I've put on my TODO list to add a regexcapture: search modifier to reference captured regex matches.

Thanks for the suggestion.

"book:potter"

You might be interested in filter macros.

To create a book: search:
In Everything, from the Search menu, click Add to filters...
Change the Name to: Book
Change the Search to: c:\MyBooks ext:mobi;pub search:
Change the Macro to: book<search>
Click OK.

Now when you search for book:potter it is replaced with:
c:\MyBooks ext:mobi;pub potter
jimspoon
Posts: 161
Joined: Tue Apr 26, 2011 11:39 pm

Re: Sorting: Ignore first 7 characters And sort

Post by jimspoon »

Would regexcapture: be something different from "regular-expression-match-1:" in the example below?

Image
void
Developer
Posts: 15365
Joined: Fri Oct 16, 2009 11:31 pm

Re: Sorting: Ignore first 7 characters And sort

Post by void »

regular-expression-match-1: will only work on filenames.

regexcapture: would work with properties and other search functions.

An example might be:
regex:property1:(\d\d\d\d) regexcapture:property2:\1

regexcapture might not be the best name, regexmatch: might be better..
jimspoon
Posts: 161
Joined: Tue Apr 26, 2011 11:39 pm

Re: Sorting: Ignore first 7 characters And sort

Post by jimspoon »

Great! I look forward to using it!
Post Reply