# How to remove part of title field

**URL:** <https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685>\
**Category:** Support\
**Created:** [October 10, 2019, 6:19am UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685 "2019-10-10T06:19:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avtem](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Avtem](https://community.mp3tag.de/u/Avtem)\
**Post date:** [October 10, 2019, 6:19am UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/1 "2019-10-10T06:19:26Z")

</div>

I have title field like this: **№2 f-moll (op.70)**  
sometimes like this: **Три блестящих вальса №1 As-dur (op.34)**  
So, as you can see it has 3 chunks (7 chunks in 2-nd example) of info separated by space. I want to delete 3-rd chunk (or 7-th).  
How can I do that?  
I tried "Guess values" with: %title% %title% %dummy%, but it won't work.

---

<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:** [October 10, 2019, 3:29pm UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/2 "2019-10-10T15:29:30Z")

</div>

If that part is always in parenthesis, you could try an action of the type  
Guess value  
Source: `%title%`  
Format string: `%title% (%dummy%)`

---

<div class="post-metadata">

**Author:** ![Avtem](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Avtem](https://community.mp3tag.de/u/Avtem)\
**Post date:** [October 10, 2019, 3:52pm UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/3 "2019-10-10T15:52:47Z")

</div>

Wow, this is such great solution! Yes, in my case it's always last chunk. Thank you so much!

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [October 11, 2019, 3:19pm UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/4 "2019-10-11T15:19:23Z")

</div>

_Just for the record:_ @Avtem  
If you remove this last "chunk \*\*" (as you name it) how do you identify such a song later?  
With only " **№2 f-moll**" as title, it is pretty hard to know what song this could be. Even in combination with the artist you get several possible results.

\*\* Opus = [https://en.wikipedia.org/wiki/Opus\_number](https://en.wikipedia.org/wiki/Opus_number)

---

<div class="post-metadata">

**Author:** ![Avtem](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Avtem](https://community.mp3tag.de/u/Avtem)\
**Post date:** [October 11, 2019, 3:32pm UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/5 "2019-10-11T15:32:59Z")

</div>

I name them like this now: **Prelude №2 f-moll**  
or valse, sonata etc.

---

<div class="post-metadata">

**Author:** ![Avtem](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Avtem](https://community.mp3tag.de/u/Avtem)\
**Post date:** [October 12, 2019, 9:00am UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/6 "2019-10-12T09:00:38Z")

</div>

_Edit_: Well, I've learned a little bit about Regular expressions and now I know how to solve the problem.

1. Select songs with **same pattern**. For example I choose this: **Prelude №2 f-moll (op.38)**. As we can see titles always have 4 parts separated by space, so now we know how the pattern looks.
2. Press `[Alt+Shift+6]`, choose `Replace with regular expression`
3. Select a field what you want to change (title, filename, album, whatever)
4. _(This step you have to check for yourself)_  
In the field ` Regular expression` paste `(\S+)` for every part of the pattern (in our case we have 4 parts) separated by spaces. And we've got this:

> (\S+) (\S+) (\S+) (\S+)

1. In the field `Replace matches with` do whatever you wan't with the parts using  
`$1 $2 $3 $4`. Where $3 in our case means following: `f-moll`  
So, I'll write here this: **$1 $3 $2**

Result will be: **Prelude f-moll №2**

---

<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:** [October 12, 2019, 9:24am UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/7 "2019-10-12T09:24:24Z")

</div>

The analysis of the pattern can always be formal or semantically.  
You have chosen the formal way.  
The semantical way could look like this:  
you have a string in front of "№" followed by a digit and you have a following string up to a an opening bracket.  
So the pattern could look like this:  
Search string: `(.*)(№\d+)(.*)\(.*`  
The replace string stays the same.  
The advantage is that the search string would also cater for  
Три блестящих вальса №1 As-dur (op.34)  
which has more blank-separated string parts in front of the № than just one.

---

<div class="post-metadata">

**Author:** ![Avtem](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Avtem](https://community.mp3tag.de/u/Avtem)\
**Post date:** [October 12, 2019, 10:05am UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/8 "2019-10-12T10:05:00Z")

</div>

Wow! This is really smart solution in my case. I think the regex `(. *)(№\d+)(.* )(.*` could be wrong.  
I've changed it a little bit, so now regex looks like this: `(.+)(№\d+) (\S+).+` and field "Replace matches with" like this: `$1 $2 $3`.  
However, my question was about "detecting" parts separated by whitespace and possibility to work with every single part. So I hope it will help those people are looking for this

_Edit: there is even simpler solution - just remove last part and a space. However I haven't figured out how to do this. I tried_ `\S+\s$`_but it doesn't work._

---

<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:** [November 11, 2019, 10:09am UTC](https://community.mp3tag.de/t/how-to-remove-part-of-title-field/46685/9 "2019-11-11T10:09:46Z")

</div>

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