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.
|