More > Media Center 15 (Development Ended)

Create Letter Folders Using the Rename Move Copy Tool?

<< < (4/6) > >>

marko:
Found this from MrC, using the black art of Regex, that does exactly the same as that nested string of "If()s"....


--- Code: ---Regex([Artist], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1])
--- End code ---

Matt:
Think we should add a function to do this?

marko:
Tough one, not least because I'm struggling to visualise how it might be constructed, and, as these just work, and can be saved as a custom library field for ease of use elsewhere, not seeing the benefit either.

So, in my "Whereisit?" view, I have a pane that contains these letters based on the expression above. The next pane, takes the same expression (not the regex coz I don't know how), but returns the first two characters, which allows me to quickly arrive at the sought for artist rather than scroll through a pane of many thousands of entries.

A function then, would need:
[x] a name
[x] source data
[x] delimited list of articles to ignore
[x] number of characters to return (defaults to 1)
[x] default mode 0 to group numerical and special character results under 0 - 9
[x] optional mode 1 to not group numerical results

Letter([Artist],The;An;A) would do what the expressions above do.
Letter([Artist],The;An;A,2) would do what the expressions above do, but return two characters instead of one.
Letter([Artist],The;An;A,2,1) would return two characters and not group numerical results.

Is that possible?
Would it be useful to others?

-marko

Matt:
We already have a list of articles (even editable by the user).  So would it be enough to just have a Mode flag to ignore the articles?  Or just always ignore the articles?

So to be clear,
Letter(The Who, 2) would return Wh
Letter(1979, 2) would return 0-9,0-9
Letter(1979, 2, 1) would return 19

Thanks for brainstorming with me!

marko:
Looks good to me (assuming the double "0 - 9,0 - 9" is a typo).

Personally, I would default to ignoring articles with a mode switch to not ignore them?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version