Dupe literal operators possible?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Dupe literal operators possible?

Post by anmac1789 »

How do you use literal operators in dupe: so that two files who necessarily don't have matching timestamps, but have individually, matching date created to date modified and date accessed, isolated so that the earliest in time file is listed? for example see screenshot below

Screenshot 2023-01-03 142226.jpg
Screenshot 2023-01-03 142226.jpg (124.43 KiB) Viewed 6455 times

so two entries are shown for which dc:=dm: but how do I further filter it down to only show the earliest file? for example, dupe:>dc=dm (earliest)

Screenshot 2023-01-03 142455.jpg
Screenshot 2023-01-03 142455.jpg (73 KiB) Viewed 6455 times
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Dupe literal operators possible?

Post by void »

Are you looking for files with matching date part only (ignore time part)?
If so, please try searching for:

dupe:daycreated;daymodified

Please note this search is slow, combine with other search filters for the best performance.



To find files where the date modified, date created and date accessed are the same for the single file, include the following in your search:

dm:==dc: dm:==da:


Finding duplicated date accessed timestamps will likely give unexpected results.
Searching for duplicated date accessed would only work if you have disabled updating of this timestamp.
Loading the icon for the shown file could update the date accessed timestamp.



What is the earliest? the earliest created? the earliest modified?
Please try sorting by Date Created or Date Modified and using the earliest file listed.


I think some information is missing here, what dupe information are you trying to match?
-If it's duplicated name, please try the following search:

dc:==dm: dupe:name distinct:name;dm-ascending

dc:==dm: will match files that have the same date create and date modified.
dupe:name will match files that share the same name with another file.
distinct:name;dm-ascending will match only one file that shares the same name with another file with the earliest date modified.

You'll need Everything 1.5.0.1333a or later to use distinct: with multiple properties.
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: Dupe literal operators possible?

Post by anmac1789 »

I have date accessed timestamps updating disabled on my PC therefore it is minimally affected. I meant the earliest date created OR date modified since it depends of each file and it's duplicates there are a variety of scenarios
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Dupe literal operators possible?

Post by void »

I meant the earliest date created OR date modified since it depends of each file and it's duplicates there are a variety of scenarios
I can only guess what you are trying to do.
Could you please expand more on what you are trying to do.


Are you trying to find files with the same date created and date modified? (ignoring the time)
-If so, include the following in your search:
dupe:daycreated;daymodified


Are you trying to find files with the same date created and date modified timestamps?
-If so, include the following in your search:
dm:==dc:



Is it enough to sort the results by date modified / date created?



Consider assigning column1 to the earliest date modified / date created:
addcol:col1 col1:=formatfiletime($dm:<$dc:?$dm::$dc:,"YYYY-MM-DD\THH:mm:ss")



I feel Everything is missing a function here.
What we really need is a way to specify a sort, eg:
sort:name;dm-ascending
THEN a way to perform a dupe/distinct/unique search based on the current sort.
For example:
distinct-no-sort:name
which would leave you with the earliest date modified name.
...I'll look into adding something here.
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: Dupe literal operators possible?

Post by anmac1789 »

In the beginning I was looking at excel function(s) to simplify this (such as max or min), which would find earliest or latest date in the current results, if it can be combined with everything commands. Usually, if there is inadequacy with everything command usage, there is likely an excel command that fills this function void

I think there has to be a better way for dupe: to filter results more correctly. Maybe the fact that skipping the previous result should be reevaluated

In addition, finding dupes shouldn't depend on the previous parameter, because it is limiting the full potential of dupes which is quite important with this software. I don't think we need new parameters but new reworking of dupes:

Dependent order of dupes should be optional. I think find-dupes:dc;dm;da should find duplicates independently of the other two. If you want further clarification please feel free to ask me for a more thorough explanation
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Dupe literal operators possible?

Post by void »

Everything 1.5.0.1334a adds support for specifying the sort before applying a dupe:, distinct: or unique: search.

dupe:, distinct: or unique: will sort the results by the specified properties.

For example, the following search:
dupe:name;size
will sort results by name and then size, then only keep items with the same name and size.

Use sort: before the call to dupe:, distinct: or unique: search function to override this sorting.



For example, show the largest file for each distinct name:
sort:name;size distinct:name



For example, show the earliest date modified file for each distinct name:
sort:name;dm-ascending distinct:name



For example, show the latest date modified file for each distinct name:
sort:name;dm distinct:name
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: Dupe literal operators possible?

Post by anmac1789 »

I'm still not understanding why sort has to be involved in this
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Dupe literal operators possible?

Post by void »

For performance reasons, Everything sorts results to find duplicates.

It's not feasible for Everything to find duplicates without sorting first.



For example, you want to find the duplicated names in the following list:

A
C
B
A

Everything will first sort the list to:

A
A
B
C

Everything will then walk over each item and compare the name with the last item to see if it is duplicated:

A (first item, nothing to compare with, so save this for the next comparison)
A (is the same as the last item, so we have a duplicate, add this item and the last item)
B (differs to the last item, skip)
C (differs to the last item, skip)

The new results look like:

A
A



Normally you don't have to specify the sort order, the results will just sort by the properties specified in dupe:, distinct: or unique:

For more control, you can specify the sort order before Everything checks for duplicates.

For example, you want to find the distinct names with the largest size in the following list of names and sizes:

A, 1
C, 100
B, 10
A, 1000

sort:name;size-descending
Everything will sort by name and then size descending and get the following list:

A, 1000
A, 1
B, 10
C, 100

This order will determine what item is kept in the list when using distinct:

distinct:name
Everything will then walk over each item and compare the name with the last item to see if it is distinct:

A, 1000 (first item, nothing to compare with, so save this for the next comparison)
A, 1 (same name as the last item, so we have a duplicate, we don't even look at the size, add the last item and skip this one)
B, 10 (differs to the last item, add)
C, 100 (differs to the last item, add)
(distinct is more complicated than this, but it should give an idea of what Everything is doing)

The new results look like:

A, 1000
B, 10
C, 100
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Dupe literal operators possible?

Post by void »

Maybe the syntax could be changed so you don't need to specify the sort order.
(Everything would still sort internally)

How would you like to search for distinct names with the largest size?

Maybe something like:
distinct:name;>size
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: Dupe literal operators possible?

Post by anmac1789 »

So sort is recommended, but i just to ask why does it need to compare in forgive me, a wierd way. In excel i could easily create a duplicate finder with some basic functions which can be more robust than somethimg complicated like this. I could use countA together with find and unique.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Dupe literal operators possible?

Post by void »

I am trying to avoid making the user define functions to find duplicated, distinct or unique items.

I'm curious, how would find distinct names with the largest size in Excel with the following data:

Code: Select all

Name	Size
A	1
C	100
B	10
A	1000
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: Dupe literal operators possible?

Post by anmac1789 »

using max and min ??? i havent tested this entirely myself but max and min i have used before to find sizes in the early days of finding duplicates just as I found out about everything
Post Reply