# More complicated action questions

**URL:** <https://community.mp3tag.de/t/more-complicated-action-questions/15059>\
**Category:** Support\
**Created:** [September 25, 2013, 6:10pm UTC](https://community.mp3tag.de/t/more-complicated-action-questions/15059 "2013-09-25T18:10:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbright](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@pbright](https://community.mp3tag.de/u/pbright)\
**Post date:** [September 25, 2013, 6:10pm UTC](https://community.mp3tag.de/t/more-complicated-action-questions/15059/1 "2013-09-25T18:10:34Z")

</div>

FileName: Gunsmoke 52-04-26 **(001)** Billy the Kid

The file name has the track number embed inside always ...three numbers surrounded by (xxx)

I want to extract out the track number and put it in the track field

So this is the Action Steps

(1) Format the Track value with the File Name Value

field: track  
format string: %\_FILENAME%

(2) I would assume this step is a "Replace with regular expression"

Field: TRACK  
Regular Expression: ??  
Replace matches with: ??

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [September 25, 2013, 7:15pm UTC](https://community.mp3tag.de/t/more-complicated-action-questions/15059/2 "2013-09-25T19:15:56Z")

</div>

One will do using the format action:

_Action type:_ **Format value**  
_Field:_ **TRACK**  
_Formatstring:_ **$num($regexp(%\_filename%,.+?((\d\d\d)).+,$1),2)**

You can replace 2 with 1 to have track 1 or if you prefer padding use 2 to have 02 as TRACK

---

<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:** [September 26, 2013, 3:30am UTC](https://community.mp3tag.de/t/more-complicated-action-questions/15059/3 "2013-09-26T03:30:00Z")

</div>

> [@stevehero](#):
>
> One will do using the format action:
> 
> _Action type:_ **Format value**  
> _Field:_ **TRACK**  
> _Formatstring:_ **$num($regexp(%\_filename%,.+?((\d\d\d)).+,$1),2)**
> 
> You can replace 2 with 1 to have track 1 or if you prefer padding use 2 to have 02 as TRACK

Or you could employ an action of the type "Import value" for %\_filename%  
Enter as import string:  
%dummy%(%track%)%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/more-complicated-action-questions/15059/4 "2026-02-09T12:24:41Z")

</div>

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


