# Take Part of Filename and Copy it to a Field

**URL:** https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477
**Category:** Support
**Created:** [July 5, 2023, 10:35pm UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477 "2023-07-05T22:35:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Andacar](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@Andacar](https://community.mp3tag.de/u/Andacar)
#### Post date: [July 5, 2023, 10:35pm UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477/1 "2023-07-05T22:35:12Z")

</div>

I've run into a lot of files where a lot of information is crammed into the file name. For example, I haave a whole bunch of files with the name in the same format:

1928 HITS ARCHIVE\_ Coquette - Guy Lombardo (Carmen Lombardo, vocal)

So I'd like to move the 1928 to _Year_, everything between \_ and - to _Title_, etc. I'd also like to rename the file to simply the title name, _Coquette_. What's a good way to approach that, or at least a reference in the documentation?

Thanks!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 6, 2023, 1:41am UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477/2 "2023-07-06T01:41:24Z")

</div>

The relevant documentation is [Import Tags from File and Folder Names – Mp3tag Documentation](https://docs.mp3tag.de/converters/import-tags-from-filenames/).

Basically, **Convert → Filename - Tag** needs a format string, which is a way to identify the parts you want to import to the tag. Actual characters and strings from the existing filename are used as anchors to describe boundaries for the `%field%` parts, which describe the flexible parts you want to import.

In your example a working format string would be

`%year% %dummy%_ %title% - %artist%`

Note, that the blanks, the underscore, and the dash characters are used as anchors. `%dummy%` is used to ignore the referenced part, so

`%year% %dummy%_ %title% - %artist% (%dummy%)`

would also omit the part in the parentheses.

Once you have the metadata imported, you can just use **Convert → Tag - Filename** with `%title%` to [rename the files](https://docs.mp3tag.de/converters/rename-files/).

---

<div class="post-metadata">

### Author: ![Andacar](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@Andacar](https://community.mp3tag.de/u/Andacar)
#### Post date: [July 6, 2023, 6:04am UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477/3 "2023-07-06T06:04:15Z")

</div>

> [@Florian](#):
>
> %year% %dummy%\_ %title% - %artist%

OK I'm starting to understand this. I have it so Guy Lombardo goes to _artist_, but if I want the stuff in parenthesis to go to _artist_, I thought it would be:

%year% %dummy%\_ %title% - %albumartist% (%artist%)

But that doesn't work. Neither does

%year% %dummy%\_ %title% - %albumartist% %dummy%(

---

<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: [July 6, 2023, 6:11am UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477/4 "2023-07-06T06:11:52Z")

</div>

> [@Andacar](#):
>
> %year% %dummy%\_ %title% - %albumartist% (%artist%)

should work for

> [@Andacar](#):
>
> 1928 HITS ARCHIVE\_ Coquette - Guy Lombardo (Carmen Lombardo, vocal)

Could it be that the hyphen is not really a hyphen but something else?

---

<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: [July 6, 2023, 6:58am UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477/5 "2023-07-06T06:58:47Z")

</div>

> [@ohrenkino](#):
>
> Could it be that the hyphen is not really a hyphen but something else?

@Andacar If you want to quick test your filename for special (unicode) characters, you can copy & paste it in the Input text box here and press "Identify":  
[https://www.babelstone.co.uk/Unicode/whatisit.html](https://www.babelstone.co.uk/Unicode/whatisit.html)  
Then you can check in the result box, if one of the text characters is not the one you used in the format string.  
For example if your hyphen is not the usual  
`U+002D : HYPHEN-MINUS {hyphen, dash; minus sign}`  
or your space is not the usual  
`U+0020 : SPACE`  
or your underscore ist not the usual  
`U+005F : LOW LINE`  
Sometimes even "normal" characters looks like A to Z but are Unicode characters like the Russian ([Cyrillic](https://en.wikipedia.org/wiki/Cyrillic_script_in_Unicode#Table_of_characters)) letters А or В

 ![image](https://community.mp3tag.de/uploads/default/original/2X/b/bd858ea7c2cfb28ad461560d7e3b848c5af3dbfa.png)

---

<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: [August 26, 2025, 2:20pm UTC](https://community.mp3tag.de/t/take-part-of-filename-and-copy-it-to-a-field/61477/6 "2025-08-26T14:20:20Z")

</div>

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