filter files have no extension

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

filter files have no extension

Post by yusef88 »

please in custom columns i need to filter two type of files one with extension tmp and the second has no extension

Code: Select all

tmp;??
To see the attached files, you need to log into the forum.

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: filter files have no extension

Post by yusef88 »

is that impossible?
found this but how applying it in custom column item filter box
TheQwerty wrote: A couple of options:

Code: Select all

!\|>^\.?[^.]+$
Would exclude folders and show only files that contain zero periods, or one period if it's the first character. (ie, "file", ".htaccess", but not ".htaccess.bak")

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: filter files have no extension

Post by Enternal »

Hmm... it should be possible but I don't quite remember how either. I will have to take a look at the notes that I have to see if there's a way. My notes are not that organized though so... might take a while haha. Unless someone answers it faster.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: filter files have no extension

Post by TheQwerty »

That quote of mine is with regards to visual filters where regular expressions can be used.
Unfortunately, custom columns doesn't currently support regular expressions nor does it appear to support the normal no extension pattern of:

Code: Select all

*.
That said, there is a work-around if you don't mind it taking up 4 custom column definitions.

1) Create a "CopyAs (Filter)" custom column and filter for those patterns XY does support (tmp).
Example snippet:

Code: Select all

Snip: CustomColumn 1
  XYplorer 14.20.0300, 7/1/2014 7:50:55 AM
Action
  ConfigureColumn
Caption
  CopyAs (Filter)
Type
  3
Definition
  return "f: <cc_name>";
Format
  0
Trigger
  2
Item Type
  0
Item Filter
  tmp
[/size]

2) Create a "CopyAs (All)" custom column that matches everything.
Example snippet:

Code: Select all

Snip: CustomColumn 1
  XYplorer 14.20.0300, 7/1/2014 7:52:40 AM
Action
  ConfigureColumn
Caption
  CopyAs (All)
Type
  3
Definition
  return "a: <cc_name>";
Format
  0
Trigger
  2
Item Type
  0
Item Filter
  
[/size]

3) Create a "Skip" custom column which is a script consisting of 'return;' and filters on '*.*' (anything containing a period). You probably also want to make this trigger on browse or list instead of on click.
Example snippet:

Code: Select all

Snip: CustomColumn 1
  XYplorer 14.20.0300, 7/1/2014 7:53:54 AM
Action
  ConfigureColumn
Caption
  Skip
Type
  3
Definition
  return;
Format
  0
Trigger
  0
Item Type
  0
Item Filter
  *.*
[/size]

4) Bring it all together. Create a 'CopyAs' custom column of type 'Mixed' and have it use the just defined columns in the order: 'CopyAs (Filter)', 'Skip', 'CopyAs (All)'.
screenshot.5.png

That final mixed 'CopyAs' column is the one you'll actually want to show and use, and you can certainly pack more into it if you want but it's probably best you leave the 'Skip' and 'CopyAs (All)' columns as the last two.

It's ugly but it works! ;)

EDIT: And of course you can technically just have your script run on everything and check the "<cc_ext>" variable within the script, but the above makes it so that the on-click arrow only shows on the desired items.
To see the attached files, you need to log into the forum.

admin
Site Admin
Posts: 67072
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: filter files have no extension

Post by admin »

One day I will add the ! operator. Then you do:

Code: Select all

!*.*

admin
Site Admin
Posts: 67072
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: filter files have no extension

Post by admin »

OK; done. 8)

yusef88
Posts: 1148
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: filter files have no extension

Post by yusef88 »

@TheQwerty
wow, i'm just amazed, very smart solution..thanks for your concern :appl:
@admin
thanks a bundle :D

DrChiron
Posts: 40
Joined: 04 Apr 2013 15:01
Location: Los Angeles environs

Re: filter files have no extension

Post by DrChiron »

@Don - (not a coder but trying to follow)
How does !*.* become a solution tp the original problem?
What does the ! operator do? Is the ! operator used elsewhere in coding?

From wikipaedia I found:
Several computer languages use "!" for various meanings, most importantly for logical negation; e.g. A != B means "A is not equal to B", and !A means "the logical negation of A" (also called "not A"). In the UK, BBC BASIC used pling as an indirection operator, equivalent to PEEK and POKE of four bytes at once.[19]
There is more of interest there, but NOT obviously relevant:
http://www.wikiwand.com/en/Exclamation_mark#pling
Retired Hollywood Video Engr
[WinX Home amd64] [XYplorer 20.80.0000]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: filter files have no extension

Post by bdeshi »

XYplorer has it's own set of script/filter rules and syntax, where ! means "invert the following operator/filter". (! usually means the same in other languages)
Read the help file of XYplorer for further info. Especially these help sections: "Scripting", "Quick Search", "Color Filters", "Visual Filters", "Find Files" to get a general idea of what various symbols mean in XY.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

DrChiron
Posts: 40
Joined: 04 Apr 2013 15:01
Location: Los Angeles environs

Re: filter files have no extension

Post by DrChiron »

@SammaySarkar - Thank you for the fast reply.

I will review those sections, but b4 I do; wouldn't inverting *.* (which I have always understood to mean ALL files with 8.3 filenames including a dot) when inverted mean NO filenames with DOTs?
I think I just answered my own question. :oops:
Retired Hollywood Video Engr
[WinX Home amd64] [XYplorer 20.80.0000]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: filter files have no extension

Post by bdeshi »

:wink:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

sgibbes
Posts: 4
Joined: 27 Aug 2014 21:53

Re: filter files have no extension

Post by sgibbes »

Hi, I am very new to this application. I think that I am asking the same thing as this user, but am not sure. And if it is the same question, I am not able to follow the 4-column solution, and was hoping someone could step me through it. My question: how can I filter the files listed by their extension, similar to windows explorer?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: filter files have no extension

Post by bdeshi »

Check out Main Menu --> View --> Tab --> Type Stats and Filter.
Does that help?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: filter files have no extension

Post by PeterH »

DrChiron wrote:@SammaySarkar - Thank you for the fast reply.

I will review those sections, but b4 I do; wouldn't inverting *.* (which I have always understood to mean ALL files with 8.3 filenames including a dot) when inverted mean NO filenames with DOTs?
I think I just answered my own question. :oops:
Just thought the same, and was starting a post to mock around... :whistle:

It would have included: *.* is any file containing a dot...
...and then I cancelled that post :oops: :biggrin:

sgibbes
Posts: 4
Joined: 27 Aug 2014 21:53

Re: filter files have no extension

Post by sgibbes »

Thanks so much for the quick reply! That is exactly what I needed for filtering by file extension (view > tab > type stats and filter)...it is even better than windows explorer in that it counts the number of files containing that extension. Thanks again!

Post Reply