Welcome Guest

Pages: 1
Action for Roman Numeral Driving me nuts
LouisMackey111PostJanuary 3, 2015, 17:10
Newbie
Posts: 14
Registered:
November 8, 2014, 19:45
Normal topicAction for Roman Numeral Driving me nuts

Greetings All,

I have been writing a large Action (actually several) to help clean up my music library (60,000+ Titles).

Since I have A number of classical tracks which contain Roman Numerals (many of which were poorly entered in the first place, I've been working on a subroutine to use regular expressions to find Roman Numerals and replace them with properly formatted Roman numerals. Of course now trying to write good optimal code I get stuck on a song that my RegEx doesn't seem to want to process.

The "Find All matches for regular expression" statement can't seem to find the Ii as the last couple of characters in the Title Field

I've set up the Action as Follows (in order to later Process Roman Numerals from 1 thru 40)

Set Variable 0 "\ "
Set Variable 1 to "ii"
Set Variable 2 to "II"
Set Variable 3 to "[-\ \/\,\.\:\;a-hj-mo-uwy-zA-HJ-MO-UWY-Z]??[-\:\:\,\/\ \.]" <-- Really, this is what I came up with to keep the RNs and letters apart
Set Variable 4 to "$S3"
Set Variable 5 to "\Z"

I then Call two inline Subroutines to search thru Album, Artist, Album Artist, Composer, & Title for Roman Numerals.

they use Find Statements like this…

Find all matches for regular expression "(\v0)(\v1)(\v3)" in field Album replace with "\ \v2\v4\ " in field Album, case insensitive set state
Find all matches for regular expression "(\v0)(\v1)(\v3)" in field Artist replace with "\ \v2\v4\ " in field Artist, case insensitive set state
Find all matches for regular expression "(\v0)(\v1)(\v3)" in field Album Artist replace with "\ \v2\v4\ " in field Album Artist, case insensitive set state
Find all matches for regular expression "(\v0)(\v1)(\v3)" in field Composer replace with "\ \v2\v4\ " in field Composer, case insensitive set state
Find all matches for regular expression "(\v0)(\v1)(\v3)" in field Title replace with "\ \v2\v4\ " in field Title case insensitive set state

And then a Search at the end of string
Find all matches for regular expression "\ \v1\v5" in field Album replace with "\ \v2" in field Album, case insensitive set state
Find all matches for regular expression "\ \v1\v5" in field Artist replace with "\ \v2" in field Artist, case insensitive set state
Find all matches for regular expression "\ \v1\v5" in field Album Artist replace with "\ \v2" in field Album Artist, case insensitive set state
Find all matches for regular expression "\ \v1\v5" in field Composer replace with "\ \v2" in field Composer, case insensitive set state
Find all matches for regular expression "\ \v1\v5" in field Title replace with "\ \v2" in field Title case insensitive set state

In this case the Title I'm looking at is "Away in a Manger ii" and it just will not be found/changed. I'm frustrated Anybody got a Suggestion or Idea?

Thanks in advance.

2MR2PostJanuary 3, 2015, 17:39
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Action for Roman Numeral Driving me nuts

Well I can take a look in the debugger to see what is happening.

Please export the action and send it to me at support@2manyrobots.com. If the action in question calls other non-inline actions please do a Smart Export.

My brain is giving up on all the backslashes 🙂

If you send it today I can look at it early tomorrow.

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.006 seconds.