Unique listing of files with the exact same filename

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Unique listing of files with the exact same filename

Post by koolestani »

Hi,
Is there a way to get a list of file names in a given folder fetched in a manner such that the names that are being repeated appear only once (no matter how many times they are actually repeated)?

Code: Select all

AAAA.txt
AAAA.txt
AAAA.txt

B.txt
B.txt

CCC.txt
CCC.txt
CCC.txt
CCC.txt

D.txt
The result should display

Code: Select all

AAAA.txt
B.txt
CCC.txt
D.txt
Thank you
Last edited by koolestani on Fri Feb 03, 2023 8:20 am, edited 2 times in total.
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Unique listing of files with the exact same filename

Post by koolestani »

Currently I make do with this workflow

Code: Select all

Select the entire result listing > Right Click > Copy Name to Clipboard > Paste in Excel > Data > Remove Duplicates
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Unique listing of files with the exact same filename

Post by NotNull »

In Everything 1.5 (the alpha version is available for testing) you can use the following search:
unique:name
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: Unique listing of files with the exact same filename

Post by void »

distinct: will find unique files (including first duplicate)
unique: will find unique files (not duplicated)

Please try the following search in Everything 1.5:
"c:\my folder\" distinct:name



This can also be done by:
Searching for: "c:\my folder\"
Right-clicking the Name column, right-clicking Find Name Duplicates and then clicking Find unique (including first duplicate)
(DISTINCT is shown in the statusbar -double click or change your search to clear the DISTINCT search)
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Unique listing of files with the exact same filename

Post by koolestani »

Once again David, you have done it! This works perfectly. Thank you.
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Unique listing of files with the exact same filename

Post by koolestani »

So I seem to be facing an odd problem, the results of
distinct:name
and
unique:name
should be mutually exclusive, correct?

Distinct should find files that have duplicates and list the first duplicate in the results.
Unique should find files that don't have any duplicate.

I can see some files that have no duplicates at all popping up when using
distinct:name
.
It seems like
unique:name
is working properly.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: Unique listing of files with the exact same filename

Post by void »

distinct: will also return unique: results

distinct:[property-list]

Find unique results (show only one result when there are duplicates) based on the current sort order or the specified semicolon delimited (;) list of properties.

distinct:



If you want to find only the first result of each duplicate, please try the following:

dupe:name distinct:name
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Unique listing of files with the exact same filename

Post by koolestani »

Hmm, that works. But is there a reason why it only works in that particular order, I tried
distinct:name dupe:name
and that doesn't work at all.
Thanks for getting me out of yet another jam. :D
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: Unique listing of files with the exact same filename

Post by void »

distinct:name dupe:name
and that doesn't work at all.
The order is important.

Everything applies search functions in order from left to right.
Everything does reorder some search functions for speed, but thats not relevant here.

The above will find distinct items first, then look for duplicates.
There will not be any duplicated results as distinct will remove them.
No results will be found.


dupe:name distinct:name
The above will find duplicated names first, then only keep the first duplicated results.
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Unique listing of files with the exact same filename

Post by koolestani »

Ok, some of it did go over my head.
Your answer works for what I wanted to do, so there's that.

I guess I'm still trying to imagine a venn diagram of the search results of unique: and distinct: and since I thought their results should be mutually exclusive, I thought the two circles won't intersect at all. But now I'm wondering what would their intersection look like.

Still I don't understand why distinct: should also show unique: results, but I am obviously out of my depth here.

Thanks again void!
Last edited by koolestani on Fri Sep 15, 2023 9:56 am, edited 1 time in total.
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: Unique listing of files with the exact same filename

Post by therube »

(Heh.

Since we're here, & since I just made some notes about it last night...
I use a Filter that I call UNIQ, which is actually runs a
distinct: sort:name
.

And I was thinking if it might not be more appropriate, for my use, to maybe use a
uniq: sort:name
instead?

I'll have to ponder it, a bit...
[Given that I've used my UNIQ for so long now, not sure I'm apt to change ;-).]


Note in my long ago written UNIQ, I did not attach a Property to distinct:.)
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: Unique listing of files with the exact same filename

Post by void »

distinct: = all results, but only keep 1 result when there's duplicates.
unique: = only results where there's no duplicates.
Post Reply