# Extract specific number of characters from filename for tag?

**URL:** <https://community.mp3tag.de/t/extract-specific-number-of-characters-from-filename-for-tag/14557>\
**Category:** Support\
**Created:** [March 20, 2013, 1:41am UTC](https://community.mp3tag.de/t/extract-specific-number-of-characters-from-filename-for-tag/14557 "2013-03-20T01:41:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottyb](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/7c8e57/32.png) [@scottyb](https://community.mp3tag.de/u/scottyb)\
**Post date:** [March 20, 2013, 1:41am UTC](https://community.mp3tag.de/t/extract-specific-number-of-characters-from-filename-for-tag/14557/1 "2013-03-20T01:41:48Z")

</div>

Love the program, but have never done any scripting. I've read the FAQ and help files, and searched the forum posts, but not finding exactly what I'm looking for. Sorry to ask what is probably a very simple question for most of you, but my brain is now mush.

I have thousands of mp3 files that have filenames that start with a catalog number  
(some 4 characters, some 5 characters).

ie:  
c2003 - Genesis 2-3

How can I make an action that copies the first 5 characters of the filename,  
and pastes them to the discnumber field?

TIA

---

<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:** [March 20, 2013, 5:47am UTC](https://community.mp3tag.de/t/extract-specific-number-of-characters-from-filename-for-tag/14557/2 "2013-03-20T05:47:46Z")

</div>

you can use the converter filename-tag and the mask:  
%discnumber% - %dummy%

I am not sure whether a discnumber has to be a real number (just like the tracknumber) and does not allow any other character than the slash

---

<div class="post-metadata">

**Author:** ![i\_edgars](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/f475e1/32.png) [@i\_edgars](https://community.mp3tag.de/u/i_edgars)\
**Post date:** [March 20, 2013, 5:47am UTC](https://community.mp3tag.de/t/extract-specific-number-of-characters-from-filename-for-tag/14557/3 "2013-03-20T05:47:47Z")

</div>

> [@scottyb](#):
>
> c2003 - Genesis 2-3
> 
> How can I make an action that copies the first 5 characters of the filename,  
> and pastes them to the discnumber field?

Convert \> Filename - Tag:

%discnumber% - %dummy%

---

<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 9, 2026, 12:24pm UTC](https://community.mp3tag.de/t/extract-specific-number-of-characters-from-filename-for-tag/14557/4 "2026-02-09T12:24:24Z")

</div>

Closed on February 9, 2026, 12:24pm UTC


