Code: Select all
$d = GetToken(ListFolder("<cc_item>", '*', 2), 'Count', '|'); // Directory count.
$f = GetToken(ListFolder("<cc_item>", '*', 1), 'Count', '|'); // File count.
return "$d Dirs, $f Files";Code: Select all
Snip: CustomColumn 1
XYplorer 13.90.0000, 3/31/2014 3:01:45 PM
Action
ConfigureColumn
Caption
Item Count
Type
3
Definition
$d = GetToken(ListFolder("<cc_item>", '*', 2), 'Count', '|'); // Directory count.
$f = GetToken(ListFolder("<cc_item>", '*', 1), 'Count', '|'); // File count.
return "$d Dirs, $f Files"
Format
0
Item Type
1
Item Filter
Likewise, there's no need to use regexreplace with FolderReport to get extensions - just use the template value:
Code: Select all
$sep = '; '; // Separator to use in the list.
$f = FolderReport('files:{ext}', 'r', "<cc_item>",,,$sep); // List of extensions.
$n = GetToken($f, 'Count', $sep); // Count of files.
if ($n < 1) {
return "F: 0"; // If no files omit extensions.
} else {
$f = FormatList($f, 'dnts', $sep); // Clean up extension list.
if ($f Like "$sep*") { $f = "<none>$f"; } // If the first item is empty add some text for non-extensions.
$f = FormatList($f, 'e', $sep); // Remove all empties now that the first is changed.
return "$f, F: $n";
}Code: Select all
Snip: CustomColumn 1
XYplorer 13.90.0000, 3/31/2014 3:09:11 PM
Action
ConfigureColumn
Caption
Contained Extensions
Type
3
Definition
$sep = '; '; // Separator to use in the list.
$f = FolderReport('files:{ext}', 'r', "<cc_item>",,,$sep); // List of extensions.
$n = GetToken($f, 'Count', $sep); // Count of files.
if ($n < 1) {
return "F: 0"; // If no files omit extensions.
} else {
$f = FormatList($f, 'dnts', $sep); // Clean up extension list.
if ($f Like "$sep*") { $f = "<none>$f"; } // If the first item is empty add some text for non-extensions.
$f = FormatList($f, 'e', $sep); // Remove all empties now that the first is changed.
return "$f, F: $n";
}
Format
0
Item Type
1
Item Filter
To use the above snippets:
- Copy the above to your clipboard.
- Open the Configure Custom Column dialog
- Right-Click the Clear button.
- Select Paste Snippet.
- OK
XYplorer Beta Club