[solved]: CC for show base name without first 4 symbols

Discuss and share scripts and script files...
Post Reply
eil
Posts: 1617
Joined: 13 Jan 2011 19:44

[solved]: CC for show base name without first 4 symbols

Post by eil »

just like topic states, hope smb can provide code for CC that shows base name excluding first 4 symbols.
target for use? = Flat View of big music folder that has a lot of names starting 01. name; 03. name; 12. name.
i remember smb in past gave me some regex CC, but can't find it now and my XY seems to lose it in some crash.
Last edited by eil on 19 Jun 2018 08:50, edited 1 time in total.
Win 7 SP1 x64 100% 1366x768

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: CC for show base name without first 4 letters needed

Post by jupe »

Here is the code for one way to do it, assuming you know how to create a custom column,

Code: Select all

 return substr(<cc_base>, 4);
And if you are unsure, how to create a custom column: https://www.xyplorer.com/release_13.90. ... bleColumns

If all the files don't follow the exact pattern you gave as an example it may be better to use an alternative method such as RegEx to account for files names like "010. FileName" etc. someone else will probably give an example of that.

Also you could do it like this which would also work in the case of my above example:

Code: Select all

 return gettoken(<cc_base>, 2, , "t", 2);

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: request: CC for show base name without first 4 symbols

Post by highend »

I'd do it this way:

Code: Select all

return regexreplace(<cc_base>, "^[0-9]+([. ]*)?");
Doesn't care about the leading number length and it takes care for a missing dot / multiple space after the leading number / dot
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1617
Joined: 13 Jan 2011 19:44

Re: request: CC for show base name without first 4 symbols

Post by eil »

thanks for answers, those fulfill my needs.!

the only question i'm left with is if there's a way to edit column list that one sees when right-clicking on header?
2018-06-19_093347.png
2018-06-19_093347.png (24.7 KiB) Viewed 3254 times
i saw an easy CC switch script, but isn't editing that list an easier solution?
Win 7 SP1 x64 100% 1366x768

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: request: CC for show base name without first 4 symbols

Post by highend »

It isn't configurable (e.g. by removing non-custom column items)
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1617
Joined: 13 Jan 2011 19:44

Re: request: CC for show base name without first 4 symbols

Post by eil »

highend wrote:It isn't configurable (e.g. by removing non-custom column items)
but is there a way to add some? like how i added that Custom1 and now in any folder in Details it proposes me it as an option to select?(if i'd only remember How i did that).
Win 7 SP1 x64 100% 1366x768

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: [solved]: CC for show base name without first 4 symbols

Post by highend »

Em, the first 5 custom columns are visible (if the screen resolution allows it)
So your "Mixed" entry is the first defined custom column...
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: [solved]: CC for show base name without first 4 symbols

Post by jupe »

You can change the order they are displayed in though, if you press the ... menu entry that is displayed under your arrow in the screenshot, then in the popup dialog you can drag the items around to sort their displayed order, so you could move that item down the list (out of view) and one that you use more often up, if that helps.

eil
Posts: 1617
Joined: 13 Jan 2011 19:44

Re: [solved]: CC for show base name without first 4 symbols

Post by eil »

i see, starting on another resolution really shows more and pop-up list can be reorganized indeed.
is there a way to reorganize the CCs own list or it's only manual .ini editing?
Win 7 SP1 x64 100% 1366x768

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: [solved]: CC for show base name without first 4 symbols

Post by highend »

Do you mean at which position they appear under Configuration | Information | Custom Columns?
Manual editing / write a script that helps with that...
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1617
Joined: 13 Jan 2011 19:44

Re: [solved]: CC for show base name without first 4 symbols

Post by eil »

highend wrote:Manual editing / write a script that helps with that...
yep, position. my newly added CC in number 16, so for sure i can't see it among 'first five", so i 'd wish to put in on 2-3 place.
Win 7 SP1 x64 100% 1366x768

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: [solved]: CC for show base name without first 4 symbols

Post by highend »

Only possible via manual editing (if you don't write a helper script / an external utility that would allow drag and drop)

Or you export both entries as snippets and reimport them vice versa afterwards...
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1617
Joined: 13 Jan 2011 19:44

Re: [solved]: CC for show base name without first 4 symbols

Post by eil »

highend wrote:Or you export both entries as snippets and reimport them vice versa afterwards...
nice idea actually! i think this should be added to official tips! worked for me.
Win 7 SP1 x64 100% 1366x768

Post Reply