sc filter does not display all files?

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

sc filter does not display all files?

Post by highend »

Let's say I have the following items (there are more, but these are enough for testing):
D:\Users\Highend\Downloads\ClassicShellSetup_3_6_1.exe
D:\Users\Highend\Downloads\DeleteTempFiles.vbs
D:\Users\Highend\Downloads\Explorer.reg
D:\Users\Highend\Downloads\free_av_7.0.1456.avastconfig
D:\Users\Highend\Downloads\wfc.exe

The following script selects all files in a folder, and creates a new string that is used for a filter command, clones the current tab and applies that filter:

Code: Select all

	sel f;
	$i = 1;
	$filter = "";
	$files = get("SelectedItemsNames", "|");
	while($i <= 5) {
		$filter = $filter . gettoken($files, $i, "|") . ";";
		$i++;
	}
	$filter = quote(substr($filter, 0, -1));
	text $filter;
	sel;
	tab("new");
	filter $filter;
the text $filter; shows the correct output (all 5 files) but when the script is finished, the new tab displays only 3 of them:

D:\Users\Highend\Downloads\DeleteTempFiles.vbs
D:\Users\Highend\Downloads\Explorer.reg
D:\Users\Highend\Downloads\free_av_7.0.1456.avastconfig

Two are missing:
D:\Users\Highend\Downloads\ClassicShellSetup_3_6_1.exe
D:\Users\Highend\Downloads\wfc.exe

Any reason for this behavior?
One of my scripts helped you out? Please donate via Paypal

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

Re: sc filter does not display all files?

Post by admin »

Your filter syntax is wrong. Each filter must be in quotes if you want exact matches:

Code: Select all

"ClassicShellSetup_3_6_1.exe"|"wfc.exe"|"free_av_7.0.1456.avastconfig"|"Explorer.reg"|"DeleteTempFiles.vbs"
This should work:

Code: Select all

sel f;
   $filter = "";
   $files = get("SelectedItemsNames", "|");
   $filter = formatlist($files, "q", "|");
   text $filter;
   sel;
   tab("new");
   filter $filter;

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: sc filter does not display all files?

Post by highend »

"ClassicShellSetup_3_6_1.exe"|"wfc.exe"|"free_av_7.0.1456.avastconfig"|"Explorer.reg"|"DeleteTempFiles.vbs"
Thanks for pointing that out.

Can you add this hint to the Visual Filter section in the help file (that you need to quote single items for exact matches)?

A small spelling mistake in the same section:
A leading ! (excalamation mark) will invert the filter, i.e. show only items *not* matching any of the patterns.
It must be: exclamation
One of my scripts helped you out? Please donate via Paypal

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

Re: sc filter does not display all files?

Post by admin »

OK, and thanks.

Post Reply