Then tried using some derivation of various solutions offered for similar questions, but don't even get close. Probably due to my slight dementia, scripting doesn't make sense to me. (If that's not the term, I apologize in advance.)
This is one of the things I've tried:
Using FORMAT VALUE
FIELD is DEBUT
STRING is debut=$regexp(%comment%,'^.*[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9]0-9].*$
which makes sense to me, but there's no result at all.
I think I'll have to make one script for each required tag, but what should I do to transfer the desired info to the relevant tags. TIA
If this is the original expression it could be $regexp(%comment%,'^.*([0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]).*$',$1)
So to get the data for DEBUT the action definition would look like this:
If this is the text in comment, then I suggest an action of the type "Guess value"
Source Format: %comment%
Guessing pattern: Debuted %debut% and peaked at %peak% on the %chart%. Source: Pop Annual. Label/Number: Ace 551. Date Peaked: %peaked%.
The DEBUT field is now populated, and I missed out the $1 at the end. But Oh how I wish the "Guess Value" action would work. I tried it but none of the fields were populated. Copied another file's comment into your suggestion, but no fields populated either. Pity, it looks a nice clean solution.
Please show me the data of at least 3 comment fields.
The guessing pattern relies on a literal representation.
So if e.g.
varies, then this data may be a case for %dummy% so that if would become
Guessing pattern: Debuted %debut% and peaked at %peak% on the %chart%. Source: %dummy%Date Peaked: %peaked%.
Also, every space and every punctuation mark also matters.
Yeah, I was just trying it out on other tracks, and it doesn't always work. So there's differences in each COMMENT.
File 1
Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.
File 2
Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.
File 10
Debuted 09/15/1958 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: MGM 12677. Date Peaked: 11/10/1958.
I understand the: $regexp(%comment%,'^.*([0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]).*,$1)`
bit and can play around with that for other date fields, and I've got an idea for how to get the other fields, but that GUESSING PATTERN is simplicity itself.
This should ignore the variable part following "Source"
If you want to assign the source to a field "Source, then try
Guessing pattern: Debuted %debut% and peaked at %peak% on the %chart%. Source: %source%. Date Peaked: %peaked%.
please check whether %chart% and %peaked% really should be followed by a dot.
I just checked it with a regular expression in Convert>Tag-Tag: $regexp('Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.','Debuted (.*) and peaked at (.*) on the (.*). Source: (.*). Date Peaked: (.*).',$1==$2==$3==$4==$5)
and got as result 11/30/1957==#1==Hot 100 Chart==Pop Annual. Label/Number: ABC-Paramount 9871==12/28/1957
which are the 5 parts from the string that you supplied.
@irljc could first use a Format value action with this regex to create a temporary field that holds the values split by == and then a trivial guess value action could split this new field into DEBUT, PEAK etc..
3 actions in an action group should do the trick.
Format value targeting a temporary tag to filter the content via regex
Guess values action to split the result into individual tags
Remove fields action to delete the temporary tag
Here's the regex with the provided examples. Should it not work for some of the files, simply adjusting the regex should make this solution more flexible than one that only relies on a single guess values action.
@ ohrenkino
I went back and checked the original tags I created, and found two were different from the names I'd used to populate the fields. After correcting them, all fields were populated as required. I HAD checked them earlier, but ... Anyway, it's working as expected now, and there's only a few titles that are not filled. Sorry about the error, 'cause that caused you extra work, but at the same time I learned something from your example. Thank you again for the help.
BTW, the fields are not separated by a "." (dot), so that would not have helped either.
Now to format the dates, but I think I can work that out. First time for everything.
Wow, that's some suggestion. I say that as I don't understand the syntax, and my regex knowledge is very limited. I've copied it and will go over it to see if I can make sense of it.
Thank you for the time you took to answer, I appreciate it very much.
Don't bother if the guess values action by @ohrenkino works after all. It's easier and my approach has no advantage over it (if the comment tag follows the example syntax strictly).
If you are interested in how you'd implement the 3 actions that I suggested, I quickly created them (only tested them on a single example file tho).
Action 1:
Format value:
Field:
TEMPSORT
Format string:
$regexp(%comment%,'Debuted (.*) and peaked at (.*) on the (.*)\. Source: (.*)\. Label\/Number: (.*)\. Date Peaked: (.*)\.',$1==$2==$3==$4==$5==$6)
Action 3:
Remove fields:
Fields to remove (semicolon-separated):
tempsort
The upside of this approach is that should there be variation in the syntax of the comment field, the regular expression in the first action could be changed to account for that, making it more flexible.
If you don't want to recreate the actions you can simply drop this into your Mp3tag actions folder: irljc.mta (391 Bytes)
Just a comment:
The preparation with the regular expression and the guessing of the values could be joined to a single action
Guess value
Source Format: $regexp(%comment%,'Debuted (.*) and peaked at (.*) on the (.*)\. Source: (.*)\. Label\/Number: (.*)\. Date Peaked: (.*)\.',$1==$2==$3==$4==$5==$6)
Guessing pattern: %debut%==%peak%==%chart%==%dummy%==%dummy%==%peaked%
That would save the need for the temporary field (and it's subsequent deletion)