Date recognition?

I have a number of automatically generated files that I am attempting to curate using MP3Tag that have names similar to the following format without any designated separation between them:

  • %album% %year% %artist% %title%
  • ABCD1234 19 10 14 Artist Name Title of recording
  • ABCD1234 2019 10 14 Artist Name Title of recording
  • ABCD1234 2019 Artist Name Title of recording

I have been using "Actions (Quick) / Replace with regular expression" to rapidly add a hyphen after %album%, however, I have not been able to find any way to automate the recognition of the date values.

Is there any functionality within MP3Tag to;

  1. Automatically recognize date values?
  2. Programmatically define that, for example, the (x)# characters after %album% should be interpreted as %year% values?
  3. Any other, smarter way to use Mp3Tag to automate this clean up effort?

To me it looks just like a set of numbers, not specially a "date" - "19" could also be "1919" if this is supposed to be a year - or 19 10 14 could be the 19th of October in a year 14 which could be 1914, 2014 whatever.
Also, by definition, YEAR is only 4 digits long. The added data would in fact lead to non-standard data in YEAR. If you want to get more detailed information, then perhaps RELEASETIME would be a better field.

Coming to the initial problem.
If you need a more complex preparation, then I would recommend an action of the type "Guess value"
Source: $regexp('ABCD1234 19 10 14 Artist Name Title of recording',(.*?) (\d+ \d\d \d\d) (.*?) (.*?),$1==$2==$3==$4)
Target string: %album%==%year%==%artist%==%title%
You would have to do something about the non-existent unique separator between ARTIST and TITLE and see how many words make up the artist's name.
Also, you would have to filter for files that match the criteria of several numbers belonging to the YEAR.
The last case with just a single number is not included in the pattern.

1 Like

Thanks @ohrenkino - I completely agree that this cleanup (over 100k+ files that have historically been largely unmanaged by my predecessor) will require several phases. Separately, I have exported a dump of metadata from all of these to Excel and am programmatically defining separators before and after %artist%, as well as standardizing the date values for later import. Unfortunately, Excel is fubaring the date values so the same approach may not work there...
Your suggestion to leverage RELEASETIME instead of YEAR is extremely interesting, I'll definitely explore that option as it would be good to retain YEAR as a standard 4-digit value.

I doubt that Excel will really be better than MP3tag - there are excellent functions to filter for certain patterns and then actions that treat the data directly without the need to export and import it to and from Excel.
I would import as much data as possible from the filenames into the fields and then use the structured data in the fields to distibute it, perhaps in several steps, to other fields.
That would be much faster than doing everything at least twice in Excel and MP3tag.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.