How can I find files that have different extension than most of the files in a folder?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
maciejchwala
Junior Member
Junior Member
Posts: 2
Joined: 2018-11-06, 09:43 UTC

How can I find files that have different extension than most of the files in a folder?

Post by *maciejchwala »

Hi :)

[short version]
I cannot figure out the way to find files that are different than most of the files in a folder - any ideas, please? :)

[longer one]
I have a folder with photos, with many subfolders and there are some other files there that I do not need (movies, .ini files etc) - I am looking for a way to find all non .jpg or .jpeg files there.
Thanks for any suggestions
:)
User avatar
obeg
Junior Member
Junior Member
Posts: 43
Joined: 2006-09-28, 09:20 UTC
Location: Sweden

Re: How can I find files that have different extension than most of the files in a folder?

Post by *obeg »

Hi

It does not solve the problem as described, but when I find myself in the same situation I use "Branch View".

So try go to the folder where you want to do a cleanup and press ctrl+b and then sort by extension. Then you will see all files in the folder and subfolders in one listing and can remove the unwanted.

br/
maciejchwala
Junior Member
Junior Member
Posts: 2
Joined: 2018-11-06, 09:43 UTC

Re: How can I find files that have different extension than most of the files in a folder?

Post by *maciejchwala »

thanks but there are too many folders there to do it that way ;)
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: How can I find files that have different extension than most of the files in a folder?

Post by *MVV »

If you know the list of "known" extensions, you can filter them out in Find Files dialog (you can save search preset and load it from buttonbar for easier access):

Code: Select all

*.* | *.jpg *.jpeg *.avi *.ini ...
But "most" without specific list is too unclear - how many files of some type should be found to treat that type as "known" and ignore it?
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How can I find files that have different extension than most of the files in a folder?

Post by *Stefan2 »

maciejchwala wrote: 2018-11-06, 09:50 UTC I am looking for a way to find all non .jpg or .jpeg files there.
MVV wrote: 2018-11-06, 11:28 UTC

Code: Select all

 *.* | *.jpg *.jpeg *.avi *.ini ...
That will still list all the folders (even with a *.jpg), because they contain one or more *.* files also.




But search *.* | *.jpg *.jpeg (find everything but JPGs)
plus [Advance] >> [x]Attributes with [_]Directory -settings
will probably find all the non-relevant files.
Afterwards a click at [Feed to listbox] and the files are listed for to copy, move or delete.


A even shorter search string is: * | *.jp*g \*
and without the need to change the Attributes setting due to the \*.


Do that work?
Press F1-key in MRT dialog to read more.

Explanation:
* >>>> find everything
| >>>> but not that listed of the right side of the pipe symbol
*.jp*g >>>> search for and exclude *.jpg or *.jpeg
\* >>>> search for and exclude folders with any name




- - -

BTW

< * | *.jp?g> doesn't work for me,

only <* | *.jp*g> does work for me.

(I just use <..> here instead of "..." quoting. I didn't use that quotes in my real search)



The "?" should work regarding to the help for <*.htm?>, but didn't work in my test in the middle of a string.


EDIT:
<*.htm?> finds only a HTML file for me.
Only <*.htm*> find all HTM and HTML files. Tested with 9.21a 32-bit on W7/64.

 
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: How can I find files that have different extension than most of the files in a folder?

Post by *Gral »

To filter out all avis, inis, jpgs AND folders - press CTRL+F12 and type:
*.*|*\ *.avi *.ini *.jpg *.jpeg
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: How can I find files that have different extension than most of the files in a folder?

Post by *MVV »

Stefan2 wrote: 2018-11-06, 12:17 UTC< * | *.jp?g> doesn't work for me
Because ? means exactly one arbitrary character, while * means zero or more arbitrary characters. So, JP?G matches JPaG, JP9G, JPzG etc but not JPG, while JP*G matches JPG, JPeG, JPaG, JPfooG, JPanythingelseG.
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How can I find files that have different extension than most of the files in a folder?

Post by *Stefan2 »

MVV wrote: 2018-11-06, 13:18 UTC Because...
Thanks.

You may be right, '?' is a joker sign, I found that now described in the help too. (less or more, still not clear)
I was confused by the RegEx meaning of that ?-sign and the example from the help >>>>: *.htm? finds all html files, (I thought that should find all htm AND html ?)


EDIT:
error finding files >> viewtopic.php?p=340317#p340317






 
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: How can I find files that have different extension than most of the files in a folder?

Post by *MVV »

Well, ? in regex is a quantifier, meaning zero or one occurence of previous element, which may be a single character, a character set in [] or a complex group in ():

Code: Select all

html? - ? applies to "l" and means zero or one "l"
b[oe]?at - ? applies to [oe] and means zero or one occurrence of ("o" or "e")
b([oe]|acteriost|)?at - ? applies to ([oe]|acteriost|) and means zero or one occurrence of ("o", "e", "acteriost" or "")
User avatar
tuska
Power Member
Power Member
Posts: 3740
Joined: 2007-05-21, 12:17 UTC

Re: How can I find files that have different extension than most of the files in a folder?

Post by *tuska »

maciejchwala wrote: 2018-11-06, 09:50 UTC I am looking for a way to find all non .jpg or .jpeg files there.

Code: Select all

TC-Search...	Alt+F7
ed:files:!<.jpg|.jpeg>
'Everything'
Search for: ed:files:!<.jpg|.jpeg> Search in TC with parameters of Everything up from current directory - adjustable directory depth!

Searching

files:Match files only
!NOT
<>Grouping
|OR
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How can I find files that have different extension than most of the files in a folder?

Post by *Horst.Epp »

tuska wrote: 2018-11-06, 16:47 UTC
maciejchwala wrote: 2018-11-06, 09:50 UTC I am looking for a way to find all non .jpg or .jpeg files there.

Code: Select all

TC-Search...	Alt+F7
ed:files:!<.jpg|.jpeg>
....
Guter Tipp 8)
Man sieht wieder, dass sich die Beschäftigung mit dem Everything Syntax im TC auszahlt.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Post Reply