Page 1 of 1

Project (part of file name) as Custom Column

Posted: 04 Sep 2017 06:00
by dietmarvar
I just discovered XYplorer one week ago and am very happy about all the things I can do that I thought are never possible when I was stuck with Microsoft Explorer. Over the last 20 years I collected many thousands of project files. I organized the files into folders by subject area. As a second dimension I wanted to capture the project that this file was created for. I looked into tags or other meta properties however these properties exist mainly for MS Office files. For pdf files, text files or other types of files there are no such file properties. So in order to be able to tag all my files regardless of file type I am maintaining a file suffix "_P#<Project>" for each file.

Using a custom column and scripting I am now able to have the project for each file in a separate column.

Code: Select all

$find = regexmatches(<cc_name>, "^(.*?_P#)", "$1");
$project = regexreplace(<cc_name>, "^(.*?_P#)(.*?(?=\.))(.*$)", "$2");
if (strlen($find) > 1) {return $project};
2017-09-03_23-57-51.png
2017-09-03_23-57-51.png (198.12 KiB) Viewed 1767 times
Very cool, now I can finally see my projects in a separate column. And I can sort by that column (and probably also filter and search which I will figure out next).

Re: Project (part of file name) as Custom Column

Posted: 04 Sep 2017 08:48
by admin
Cool. :tup:

To search by that column it should be enough to prefix the search with the column name, e.g. "Project:Dart".

See also here:
https://www.xyplorer.com/release_14.00.php#ColumnSearch

Re: Project (part of file name) as Custom Column

Posted: 04 Sep 2017 09:12
by highend
Shorter...

Code: Select all

if(strpos(<cc_base>, "_P#") != -1) { return regexreplace(<cc_base>, "^(.*_P#)([^.]+)(.*)", "$2"); }

Re: Project (part of file name) as Custom Column

Posted: 05 Sep 2017 02:28
by dietmarvar
Thanks Don and highend. I switched to your shorter script version.