Actions: from filename to genre and date format regular expression

Hi! I have two moments for making my music sorting ideal! Can you help me, please?

  1. I have the collection with filenames like:
    Artist 1 - track 1#genre1.mp3
    Artist 2 - track 1#genre2.mp3
    Artist 3 - track 1#genre3.mp3

can I use actions to replace all these genres to "Genre" tag (and after it delete "#..." part from filename)?

  1. I have "release time" tags like:

I use replace in actions to make it all with "-" instead "/"
After it I'm trying replace with regular expression a{2}-b{2}-c{4} -> c{4}-a{2}-b{2} to move year to beginning, but it doesn't work. What is right expression for it?

Also sometimes release time is somehow like: or longer
So it will be perfect ot leave only first 10 characters in this tag.

Will be happy if someone help me with this, thanks!

The action of the type "Guess values" works just like the function Convert>Filename-Tag, so you can enter the same pattern e.g.:
Artist 1 - track 1#genre1.mp3
%artist% - %title%#%genre%
or if you want to get only the GENRE:

Swapping different parts of a string for the date should be:
Search string: (\d+)-(\d+)-(\d+)
Replace string: $3-$1-$2

Hi ohrenkino, thanks for quick reply! But I have two problems with your advices:

  1. Guess values works good! But I have .mp3 in genre too -
    How can I remove ".mp3" from genre and can I delete #genre from filename after step 1?

  2. This expression shuffle all my dates like
    So I need something to format "aa-bb-cccc -> cccc-aa-bb" for keeping "aaaa-*" dates as they are
    and make and keep it from only first 10 symbols because of sometimes it's like "2015-08-18\\2015-08-18\\2015-08-18", so maybe first cut it...

My advice should not cause any trouble but the supplied data should.
To remove ".mp3" from Genre (how did that come about?) use a simple replace: search for ".mp3" and replace it with nothing.
To get a clean filename I would suggest that you rewrite the filename with Convert>Tag-Filename as the data is now much better stored in the fields.

Yes it does. It is not intelligent.
You could filter for the files that have no 4-digit-data at the front:
NOT %field% MATCHES ^\d\d\d\d
(I do not know where you store the date as there are only the fields YEAR and RELEASETIME - but these have a completely different standard.
You then transform all the dates to a uniform pattern.

Oh, yes, exactly! Thanks!

Oh, yes, it's work too, thanks!
Sadly, that it can't be automated with Actions, I thought that replacement with expressions like xxxx-yy-zz -> yy-zz-xxxx possible..
And actions to cut string to first 10 symbols not possible too?

If the dates should always be turned around (which I would not recommend as you then get all tracks from a particular month or day sorted togehter) then of course you can set it like that.
To define one chunk, enclose it in parenthesis, e.g. (\d\d\d\d). All the bits in parenthesis can then be adresse with $1, $2, $3 etc counting the parenthesis from left to right.

The date that you showed with the \\ looks to me like a multi-value-field. You either have to merge the duplicate fields first with a different separator than \\ (there is an action for that) or use "Format value" with the $meta() function to address a particular field of the duplicates.

Oh, really, I see!
Fileds are really multi-valued, I get it from beatport app and sometimes it in format YYYY-MM-DD and sometimes MM-DD-YYYY (but at this moment always month going first) and sometimes multi-valued.
So, after these actions I have date like this -

It's good! But tell me once again please, how to cut merged tag? It has no permanent limit, can be dublicated 2,3,4 times, but I can't find something like * (like "if any text next") in expressions to replace it..

If you have a display like
for a field e.g. DATE
The create an action of the type "Merge duplicate fields"
Field: DATE
After that action you have only one field DATE with the contents
You can now $trimleft(10)
that field in an action of the type "Format tag-field"

Of if you like a "Replace with regular expression" better
Search string: _.*
Replace string:
(leave empty)
(in your case it is the -- instead of the _)

ohrenkino, works great! Thanks!! You helped make my collection of perfect! :slight_smile:

Hi I cleaned my music collection with Mp3tag and now it's in excellent form, but..
All tags that going from one program to another are staying right, except.. yes, this is realasetime.

I tried in MusicBee and Traktor.

Firslty I used format YYYY-MM-DD, than, by your (ohrenkino) advice from here I tried YYYY-MM-DDThh:mm:ss but it's still has format YYYY/1/1 in Traktor end empty in MusicBee.
If I use YYYY/MM/DD it's still YYYY/1/1/ in Traktor.

I didn't found any solutions more. Maybe have any ideas how to keep it everywhere?

The problem could be:
target program does not dispaly the field at all (looks like that in MusicBee).
target program does not update the information.
For Traktor there is this thread:
It suggests that you right-click and check the consistency. Then the updated date should be shown.

ohrenkino, when I'm changing date in Mp3tag and looking in Traktor again - year is changing but other part - no, so I think dates udated but trouble with format or something

The field YEAR has as only valid format a 4-digit-number.
Some programs support also the field DATE which holds month and day.
Some programs combine these 2 fields to one display, yet the data is stored in 2 fields.
So, perhaps you have to fill the field DATE as well.

Oh, really! In Traktor it's "DATE"+"YEAR", so I need take current MM.DD.YYYY and replace parts MMDD and YYYY from my full date to two tags, yes?
and one special with MusicBe...
Maybe I can fill this in MusicBee then look somehow format that writen in file by it?

Copy all of YEAR into date with an action of the type "Format value" for DATE.
Format string: %year%

Then $cutright() or $cutleft() or Replace with regular expression to get the right amount of data into the field.

I copied data to 'year' and 'date' and replace them with reg exp to desired format, so it works great!

Now I'm going to make custom field with same data and make it available in MusicBee (with it "Virtual tags") and asking this on MusicBee forum but they are not so quick as guys there :slight_smile: