# Help Using Actions to split filename

**URL:** <https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650>\
**Category:** Support\
**Created:** [January 8, 2023, 9:21pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650 "2023-01-08T21:21:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [January 8, 2023, 9:21pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650/1 "2023-01-08T21:21:51Z")

</div>

Hi  
I am trying to learn Action but cannot seem to get this Action to work.

I have a track - (1974) Brent Dowe Don't Get Weary.mp3 It has no tags

I would like to remove the (1974), (in fact if the Action could remove the Year anywhere it appears that would be great.

Brent Dowe is the Artist  
Don't Get Weary i s the title of the track

Is it possible to get MP3Tag to extract Artist , Title from the Filename and put them into the relative tag field or will I have to do it manually.

Alos is there anywhere i could find some training/examples of Actions etc please.

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 8, 2023, 9:31pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650/2 "2023-01-08T21:31:35Z")

</div>

I would not use an action but the function Convert\>Filename-Tag to get data from the filename.

More about this function can be found in the documentation:

> **[First Steps – Mp3tag Documentation](https://docs.mp3tag.de/getting-started/first-steps/#importing-parts-of-the-file-name-to-the-tag)**
>
> A collection of tasks with step-by-step instructions intended for novice users of Mp3tag. Mp3tag is the universal Tag Editor.

> [@cldcp00](#):
>
> (1974) Brent Dowe Don't Get Weary.mp3

If that is an accurate representation of the filename and you want to get the artist and title, then try:  
Convert\>Filename-Tag  
Pattern: (%dummy%) %title%  
(Why do you want to delete the year? It is very tricky to find the correct year for a file, once you have deleted it)  
If you change your mind:  
Pattern: (%year%) %title%

The problem with this filename is that there is no decent separator between the artist and the title.  
But with the suggested mask you get at least the field TITLE.  
You could then, if the data for ARTIST always consists of 2 words, use an action of the type "Guess value"  
Source: `$regexp(%title%,(.*?) (.*?) (.*),$1 $2==$3)`  
Target string: `%artist%==%title%`

---

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [January 8, 2023, 9:51pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650/3 "2023-01-08T21:51:03Z")

</div>

Thanks your answer is very much appreciated

---

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [January 14, 2023, 9:33pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650/4 "2023-01-14T21:33:50Z")

</div>

> [@ohrenkino](#):
>
> Target string: `%artist%==%title%`

Thanks for your reply, just one thing that is confusing me the the use of ==

what does this mean in Target string: `%artist%==%title%`

And in Source: `$regexp(%title%,(.*?) (.*?) (.*),$1 $2==$3)`

Thanks for any help

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 14, 2023, 9:42pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650/5 "2023-01-14T21:42:05Z")

</div>

> [@cldcp00](#):
>
> the use of ==

That looks like magic, doesn't it?  
But it is actually quite trivial: I just tried to insert a unique separator between the string parts.  
In the regular expression there are the first 2 words and then the rest of the string with variable length.  
The regular expression does nothing but to create a string which contains these parts plus the unique separator. And I thought that there are very few artists and titles that contain these == which would make them a good unique separator.

Or to cut this short: you could use anything else from which you know that that combination is not part of the data in the fields.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 13, 2023, 9:42pm UTC](https://community.mp3tag.de/t/help-using-actions-to-split-filename/59650/6 "2023-02-13T21:42:53Z")

</div>

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