Page 1 of 1

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

Posted: 18 Jun 2018 22:36
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.

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

Posted: 18 Jun 2018 22:40
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);

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

Posted: 18 Jun 2018 23:45
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

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

Posted: 19 Jun 2018 08:44
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
i saw an easy CC switch script, but isn't editing that list an easier solution?

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

Posted: 19 Jun 2018 08:47
by highend
It isn't configurable (e.g. by removing non-custom column items)

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

Posted: 19 Jun 2018 08:53
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).

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

Posted: 19 Jun 2018 08:58
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...

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

Posted: 19 Jun 2018 09:10
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.

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

Posted: 19 Jun 2018 09:22
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?

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

Posted: 19 Jun 2018 09:29
by highend
Do you mean at which position they appear under Configuration | Information | Custom Columns?
Manual editing / write a script that helps with that...

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

Posted: 19 Jun 2018 09:34
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.

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

Posted: 19 Jun 2018 09:39
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...

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

Posted: 19 Jun 2018 09:57
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.