path-part in custom columns?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

path-part in custom columns?

Post by anmac1789 »

How do I use path-part: in custom columns ?
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: path-part in custom columns?

Post by void »

addcolumn:column1 column1:=$path:
-or-
addcolumn:column1 column1:=$pp:

$pp: = Path Part for short.


I'll add a $pathpart: alias..
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: path-part in custom columns?

Post by anmac1789 »

column1:=$pp:("C:\users\username\random\folder\") like this?
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: path-part in custom columns?

Post by void »

If you are referring to the PATH_PART() function call:

column1:=pathpart("C:\Windows\Notepad.exe")
=>
column1:=C:\Windows
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: path-part in custom columns?

Post by anmac1789 »

void wrote: Wed Jan 25, 2023 3:25 am If you are referring to the PATH_PART() function call:

column1:=pathpart("C:\Windows\Notepad.exe")
=>
column1:=C:\Windows
I mean you know how if you use path-part:"*\random\folder" it will give you all results where the last part of the path matches random\folder But I want to use it this on a custom column because it has other parameters too

But how do I combine like the last 4 brackets of a path so path-part(path:,4) something like this? for each file/folder's path ?
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: path-part in custom columns?

Post by void »

The last 4 subfolders/filename?

It gets ugly, but try something like:

Code: Select all

column1:=PATHCOMBINE(BASENAME(PATHPART(PATHPART(PATHPART($fullpath:)))),PATHCOMBINE(BASENAME(PATHPART(PATHPART($fullpath:))),PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:))))
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: path-part in custom columns?

Post by anmac1789 »

void wrote: Wed Jan 25, 2023 3:36 am The last 4 subfolders/filename?

It gets ugly, but try something like:

Code: Select all

column1:=PATHCOMBINE(BASENAME(PATHPART(PATHPART(PATHPART($fullpath:)))),PATHCOMBINE(BASENAME(PATHPART(PATHPART($fullpath:))),PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:))))
Doesnt seem to show any result except the command name in column 1

Update: Nevermind, I had made a typo

Also, how can I customize it so that I can show the last 3, 4 or however many number of slashes from the right end of the path working towards the left?
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: path-part in custom columns?

Post by void »

Remove or add PATHCOMBINE() as needed.

4 parts:

Code: Select all

 
column1:=PATHCOMBINE(BASENAME(PATHPART(PATHPART(PATHPART($fullpath:)))),PATHCOMBINE(BASENAME(PATHPART(PATHPART($fullpath:))),PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:))))
3 parts:

Code: Select all

 
column1:=PATHCOMBINE(BASENAME(PATHPART(PATHPART($fullpath:))),PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:)))
2 parts:

Code: Select all

 
column1:=PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:))
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: path-part in custom columns?

Post by anmac1789 »

void wrote: Wed Jan 25, 2023 4:01 am Remove or add PATHCOMBINE() as needed.

4 parts:

Code: Select all

 
column1:=PATHCOMBINE(BASENAME(PATHPART(PATHPART(PATHPART($fullpath:)))),PATHCOMBINE(BASENAME(PATHPART(PATHPART($fullpath:))),PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:))))
3 parts:

Code: Select all

 
column1:=PATHCOMBINE(BASENAME(PATHPART(PATHPART($fullpath:))),PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:)))
2 parts:

Code: Select all

 
column1:=PATHCOMBINE(BASENAME(PATHPART($fullpath:)),BASENAME($fullpath:))

I can't narrow down the results using a specified path ?
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: path-part in custom columns?

Post by void »

Replace $fullpath: with your path.
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: path-part in custom columns?

Post by anmac1789 »

void wrote: Wed Jan 25, 2023 4:17 am Replace $fullpath: with your path.
Its still shows other paths which are unrelated to the specified path
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: path-part in custom columns?

Post by void »

There's a few instances of $fullpath:
Please make sure you replace each instance of $fullpath:
Post Reply