Page 1 of 2

filter files have no extension

Posted: 19 Jun 2014 21:10
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;??

Re: filter files have no extension

Posted: 30 Jun 2014 03:54
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")

Re: filter files have no extension

Posted: 01 Jul 2014 09:21
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.

Re: filter files have no extension

Posted: 01 Jul 2014 14:10
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.

Re: filter files have no extension

Posted: 01 Jul 2014 14:27
by admin
One day I will add the ! operator. Then you do:

Code: Select all

!*.*

Re: filter files have no extension

Posted: 01 Jul 2014 14:37
by admin
OK; done. 8)

Re: filter files have no extension

Posted: 01 Jul 2014 18:24
by yusef88
@TheQwerty
wow, i'm just amazed, very smart solution..thanks for your concern :appl:
@admin
thanks a bundle :D

Re: filter files have no extension

Posted: 20 Jul 2014 01:40
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

Re: filter files have no extension

Posted: 20 Jul 2014 07:59
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.

Re: filter files have no extension

Posted: 22 Jul 2014 04:39
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:

Re: filter files have no extension

Posted: 22 Jul 2014 07:07
by bdeshi
:wink:

Re: filter files have no extension

Posted: 27 Aug 2014 23:25
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?

Re: filter files have no extension

Posted: 28 Aug 2014 05:59
by bdeshi
Check out Main Menu --> View --> Tab --> Type Stats and Filter.
Does that help?

Re: filter files have no extension

Posted: 28 Aug 2014 11:43
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:

Re: filter files have no extension

Posted: 28 Aug 2014 17:04
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!