Custom Column Filter Help - Truncating Filenames

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
muzicman82
Posts: 19
Joined: 19 Dec 2019 20:48

Custom Column Filter Help - Truncating Filenames

Post by muzicman82 »

I'd like to create custom column that does this...

client.01.02.20.jobname.jobsite.somedocumenttitle.doc

The column would display this, ignoring the first word (client) and the date which is segmented by dots.
jobname.jobsite.somedocumenttitle

I assume that once this column is set up, I can then sort by the results.

Thoughts?

EDIT. I think this is working for me to show segments as needed, just concatenating the ones I want to show.

Code: Select all

$base = getpathcomponent(<cc_name>, "base");
$filter1 = gettoken($base, 5,".");
$filter2 = gettoken($base, 6,".");
$full = $filter1.".".$filter2;
return $full;

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

Re: Custom Column Filter Help - Truncating Filenames

Post by highend »

return regexreplace(<cc_item>, "^(.+\d{1,2}\.\d{1,2}\.\d{2,4}\.)(.+?)(\.[^\.]+)$", "$2");?
One of my scripts helped you out? Please donate via Paypal

muzicman82
Posts: 19
Joined: 19 Dec 2019 20:48

Re: Custom Column Filter Help - Truncating Filenames

Post by muzicman82 »

highend wrote: ↑24 Apr 2020 10:55 return regexreplace(<cc_item>, "^(.+\d{1,2}\.\d{1,2}\.\d{2,4}\.)(.+?)(\.[^\.]+)$", "$2");?
Thanks!

Is it possible to use a Custom Column result, and quickly apply that as a tag? Like, in the Tags field, can I just enter a variable like "My Column Name" and it applies whatever is in that column as a tag to the selected files?

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

Re: Custom Column Filter Help - Truncating Filenames

Post by highend »

Sure, via scripting.
One of my scripts helped you out? Please donate via Paypal

muzicman82
Posts: 19
Joined: 19 Dec 2019 20:48

Re: Custom Column Filter Help - Truncating Filenames

Post by muzicman82 »

highend wrote: ↑24 Apr 2020 11:01 Sure, via scripting.
Well, I figured that. How do I access the data in a column for scripting? Are there variables for columns by name or does it have to be by a specific position?

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

Re: Custom Column Filter Help - Truncating Filenames

Post by highend »

Via report()

Read the help file entry for it, especially: "Extra Columns" & "Custom Columns"
One of my scripts helped you out? Please donate via Paypal

Post Reply