# I need help changing album names from "451 # Back in the USA" to

**URL:** https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018
**Category:** General Discussion
**Created:** [January 29, 2012, 1:25pm UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018 "2012-01-29T13:25:47Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Marcabove](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3d9bf3/32.png) [@Marcabove](https://community.mp3tag.de/u/Marcabove)
#### Post date: [January 29, 2012, 1:25pm UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/1 "2012-01-29T13:25:47Z")

</div>

"Back in the USA (No. 451)". I know that this is done with regular expression but they whip me.

Thanks

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [January 29, 2012, 1:56pm UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/2 "2012-01-29T13:56:10Z")

</div>

> [@Marcabove](#):
>
> I need help changing album names from "451 # Back in the USA" to "Back in the USA (No. 451)". I know that this is done with regular expression but they whip me.Thanks

Filter:

**ALBUM MATCHES "^(\d+)\s+#\s+(.+?)$"**

Action: Format value  
Field: ALBUM  
Formatstring: **$regexp(%ALBUM%,'^(\d+)\s+#\s+(.+?)$','$2 (No. $1)')**

DD.20120129.1557.CET

---

<div class="post-metadata">

### Author: ![Marcabove](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3d9bf3/32.png) [@Marcabove](https://community.mp3tag.de/u/Marcabove)
#### Post date: [January 29, 2012, 6:19pm UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/3 "2012-01-29T18:19:17Z")

</div>

Thanks!

---

<div class="post-metadata">

### Author: ![Marcabove](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3d9bf3/32.png) [@Marcabove](https://community.mp3tag.de/u/Marcabove)
#### Post date: [January 29, 2012, 6:25pm UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/4 "2012-01-29T18:25:20Z")

</div>

Is there a source that explains regular expression in an understandable way? Most have lots of explanation but few examples. I really hate to ask for help with these but they just don't click for me.

Thanks

---

<div class="post-metadata">

### Author: ![Marcabove](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3d9bf3/32.png) [@Marcabove](https://community.mp3tag.de/u/Marcabove)
#### Post date: [January 31, 2012, 8:52pm UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/5 "2012-01-31T20:52:18Z")

</div>

If I understand this I can also use this to do the same thing but with folder names also? If the folder is formatted "448) Cheap Trick ~ In Color (1977)" and the album is only "In Color" I can extract the "448)" and make the album name "In Color (No. 448).

---

<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: [February 2, 2012, 5:10am UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/6 "2012-02-02T05:10:01Z")

</div>

If you have the correct information in the tags why don't you use the converter "Tag - Filename"?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 2, 2012, 6:19am UTC](https://community.mp3tag.de/t/i-need-help-changing-album-names-from-451-back-in-the-usa-to/13018/7 "2012-02-02T06:19:57Z")

</div>

> [@Marcabove](#):
>
> If I understand this I can also use this to do the same thing but with folder names also? If the folder is formatted "448) Cheap Trick ~ In Color (1977)" and the album is only "In Color" I can extract the "448)" and make the album name "In Color (No. 448).

Yes, if you understand this, you can.

Filter:

**"%\_directory%" MATCHES "^(\d+)\)\s+(.+?)\s+~\s+(.+?)\s+\((\d+)\)$"**

Action: Format value  
Field: ALBUM  
Formatstring: **$regexp(%\_directory%,'^(\d+))\s+(.+?)\s+~\s+(.+?)\s+((\d+))$','$3 (No. $1)')**

Keep in mind, that renaming a folder is not only the process of giving the thing a new name, but it can result into a moving of the folder to another place in the file system. I rate this as a critical action and one must be careful what to do.

As user 'ohrenkino' said in this thread, for the long shot, it would come in handy, that all relevant data are stored within the media file in tag-fields.

Once this situation has been created ...

"448" ... put into ... CATALOG\_ID  
"Cheap Trick" ... put into ... ARTIST  
"In Color" ... put into ... ALBUM  
"1977" ... put into ... RELEASEDATE or maybe YEAR

.. then the renaming resp. moving of the folder can be done this way ...

1. Probably there is no need to apply a filter.
2. Apply an action "Format value".  
Field: \_DIRECTORY  
Formatstring : **%ALBUM%' (No. '%CATALOG\_ID%')'**

.. that's it.

How to get data from filename or foldername and put it into the tag-fields within the media file?

Use Mp3tag converter "Filename - Tag".  
This converter can handle the names of folders or directories too, when formatting a mask, that represents a path string.

Fill the edit field with this **format mask** _(each literal character is taken as is, no scripting functions allowed)_ ...

**%CATALOG\_ID%) %ARTIST% ~ %ALBUM% (%YEAR%)\%DUMMY%**

... then the converter preview shows ...

**CATALOG\_ID 448  
ARTIST Cheap Trick  
ALBUM In Color  
YEAR 1977**

In this example the format mask represents the filesystem path situation of "folder\filename".  
The placeholder %DUMMY% stands here for the filename, and discards the filename.  
But the filename can be disassembled the same way by applying an appropriate format mask.

DD.20120202.0820.CET
