How to return all characters after ( and before ) in a file name

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Schuller
Posts: 130
Joined: 02 May 2023 21:08

How to return all characters after ( and before ) in a file name

Post by Schuller »

Hi ,

I'm trying to return all the characters after ( and before ) in a file name into a custom column.
Can anyone please let me know the script for this.

Thanks

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

Re: How to return all characters after ( and before ) in a file name

Post by highend »

gettoken() * 2?
One of my scripts helped you out? Please donate via Paypal

Schuller
Posts: 130
Joined: 02 May 2023 21:08

Re: How to return all characters after ( and before ) in a file name

Post by Schuller »

If my file name is this:
2024-09-19(209CT-209Hydro&Water) $842.28

What exactly do I write in the script area of the custom column configuration to return exactly this into a custom column:
209CT-209Hydro&Water

RalphM
Posts: 1978
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: How to return all characters after ( and before ) in a file name

Post by RalphM »

I think it is about time for you to make an effort and try to read and make sense of the help file. :whistle:
Ralph :)
(OS: W11 23H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

Schuller
Posts: 130
Joined: 02 May 2023 21:08

Re: How to return all characters after ( and before ) in a file name

Post by Schuller »

Trust me, I've spend an enormous amount of time and effort in the help file and more time managing the file manager than getting work done.
Its okay, I'll pass on this sort of assistance. Gotta get back to work.
Last edited by Schuller on 06 Oct 2024 11:36, edited 1 time in total.

Schuller
Posts: 130
Joined: 02 May 2023 21:08

Re: How to return all characters after ( and before ) in a file name

Post by Schuller »

If anyone else comes across this post and has the exact syntax to return what I'm seeking for then please respond with it and please include a donation option and I'll be sure to donate.

Thanks

klownboy
Posts: 4238
Joined: 28 Feb 2012 19:27

Re: How to return all characters after ( and before ) in a file name

Post by klownboy »

Just what highend stated (gettoken *2) so any donations should go to him.

Code: Select all

return gettoken(gettoken(gpc(,"file"),"2","("),"1",")");
Configure Custom Column.jpg
Configure Custom Column.jpg (54.92 KiB) Viewed 585 times
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Schuller
Posts: 130
Joined: 02 May 2023 21:08

Re: How to return all characters after ( and before ) in a file name

Post by Schuller »

I put exactly:

return gettoken(gettoken(gpc(,"file"),"2","("),"1",")");

and it returns nothing

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

Re: How to return all characters after ( and before ) in a file name

Post by highend »

Code: Select all

return gettoken(gettoken(<cc_base>, 2, "("), 1, ")");
^^
One of my scripts helped you out? Please donate via Paypal

Schuller
Posts: 130
Joined: 02 May 2023 21:08

Re: How to return all characters after ( and before ) in a file name

Post by Schuller »

Thank you!

klownboy
Posts: 4238
Joined: 28 Feb 2012 19:27

Re: How to return all characters after ( and before ) in a file name

Post by klownboy »

Yeah, it worked for me, but I should have used <cc_base> for use in a custom column>. :whistle:
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Post Reply