# Repathing in an Action

**URL:** https://community.mp3tag.de/t/repathing-in-an-action/9810
**Category:** Support
**Created:** [February 1, 2010, 3:36pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810 "2010-02-01T15:36:50Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 1, 2010, 3:36pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/1 "2010-02-01T15:36:50Z")

</div>

How in an Action can I change the path of a track from e.g.

Curtains\30s\Loud\02480002928225-1-1.wma

to

Curtains\02480002928225-1-1-30s-Loud.wma

?

(I need this to work around Windows Media Player 11 Sync's Mis\_IDing as duplicates same filenamed and sized files in different directories.)

Thanks.

---

<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 1, 2010, 5:38pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/2 "2010-02-01T17:38:51Z")

</div>

> [@chrisjj](#):
>
> How in an Action can I change the path of a track from e.g.
> 
> Curtains\30s\Loud\02480002928225-1-1.wma  
> to  
> Curtains\02480002928225-1-1-30s-Loud.wma
> 
> Thanks.

if there the original path has been constructed by using tags you can use the tag-filename function again - that would be easisest.

if you need to rearrange parts of the filename it would look something like this:

Find string:  
`(.*)\(.*)\(.*)\(.*)` which is supposed to be the equivalent of:  
(Curtains)(30s)(Loud)(02480002928225-1-1)  
the brackets divide the whole thing into several hits:  
($1)$2)($3)($4)

Now you have to rearrange all of it in the  
replace with string  
`$1$4-$2-$3

BUT: before you apply it to all of your tracks try it first on a single one where it does not hurt so much if I was wrong.  
Probably the correct help will come from one of the reg-exp-nerds. I am always ready to learn

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 1, 2010, 5:46pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/3 "2010-02-01T17:46:13Z")

</div>

> [@ohrenkino](#):
>
> you can use the tag-filename function

In an Action? How, please?

---

<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 1, 2010, 5:53pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/4 "2010-02-01T17:53:41Z")

</div>

> [@chrisjj](#):
>
> In an Action? How, please?

it says function not action, doesn't it?

anyway: the following description of my prior reply refers to the action format tag-field on the field filename - I had hoped that that would have been clear. Never mind.

Please continue reading and find whether those notes are helpful to you.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 1, 2010, 6:05pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/5 "2010-02-01T18:05:24Z")

</div>

> [@ohrenkino](#):
>
> it says function not action, doesn't it?

Yes, and I cannot find it as a function either. If it does solve "How in an Action can I change the path of a track..." please do say how.

> [@](#):
>
> anyway: the following description of my prior reply refers to the action format tag-field on the field filename

If you're referring to a "Format value" Action, thanks, but that doesn't work because it applies only to filename, not full path.

---

<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 1, 2010, 6:21pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/6 "2010-02-01T18:21:31Z")

</div>

> [@chrisjj](#):
>
> If you're referring to a "Format value" Action, thanks, but that doesn't work because it applies only to filename, not full path.

have you tried it or do you onyl suspect it?  
Actually inserting a backslash will set a new path structure. You can try this with the (her it comes again) tag-filename function (see menu converter) and enter a mask like  
%artist%\%album%\%track% - %title%  
and you will get a directory with the name of the artist, containing one with the name of the album, filled with the tracks ...

So: formatting the filename with characters that are otherwise used for paths will create a directory structure relative to the currently read directory. Unless you enter an absolute path  
"C:\music\%artist% ..."  
This should work in the action.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 1, 2010, 6:38pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/7 "2010-02-01T18:38:51Z")

</div>

> [@ohrenkino](#):
>
> have you tried it or do you onyl suspect it?

I'm going by what is allowed... isnce I know better than to reply on undefined/bugged behavior!

> [@](#):
>
> Actually inserting a backslash will set a new path structure.

You're right. That's a failure to work properly since the target "field" is specifically \_FILENAME. Florian, one for your bug list.

> [@](#):
>
> will create a directory structure **relative to the currently read directory.**

That's the snag. It won't in general work in the example given:

e.g. Curtains\30s\Loud\02480002928225-1-1.wma  
to Curtains\02480002928225-1-1-30s-Loud.wma

and will never work where the files are in different first folders (Curtains).

Thanks for the info though.

---

<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 1, 2010, 7:01pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/8 "2010-02-01T19:01:13Z")

</div>

> [@chrisjj](#):
>
> ... That's a failure to work properly

In the old DOS days a full filename consisted of the path, the filename and the extension - it was only for the users convenience to be able to strip the filename from the other load.  
So in my opinion MP3tag works just the way the filesystem is composed.

Back to the "relative" path.  
If you enter the parts of the filename that qualify an absolute filename you will get an absolute path.  
so a path like  
c:\curtains\xx\yy\zz filled with your variables will create an absolute path just fine.  
The only precondition is that you start MP3tag on the topmost level to read all the files.  
And before you accuse others of

> [@chrisjj](#):
>
> undefined/bugged behavior

please think twice, research and then try to be polite.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 1, 2010, 7:55pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/9 "2010-02-01T19:55:58Z")

</div>

> [@ohrenkino](#):
>
> In the old DOS days a full filename consisted of the path, the filename and the extension ...  
> So in my opinion MP3tag works just the way the filesystem is composed.

Snag is, Mp3tag is not in general working like that e.g. replace \_FILENAME with XX **does** change just the filename.

> [@](#):
>
> Back to the "relative" path.  
> If you enter the parts of the filename that qualify an absolute filename you will get an absolute path.

Sure, but as the original post says, the requirement is for changing relative paths, not absolute.

---

<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: [February 1, 2010, 8:08pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/10 "2010-02-01T20:08:42Z")

</div>

This is the solution to your problem, chrisjj:

_Action type:_ **Format value**  
_Field:_ **\_FILENAME**  
_Formatstring:_ **....\%\_filename%**

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 1, 2010, 8:35pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/11 "2010-02-01T20:35:10Z")

</div>

Thanks Florian, but doesn't work here (V2.45a): e.g.

S:!DJ DAP\WIP Mp3tag curtain repath\Curtains\30s\Loud\02480002928225-1-4.wma  
goes to  
S:!DJ DAP\02480002928225-1-4.wma  
rather than  
S:!DJ DAP\WIP Mp3tag curtain repath\Curtains\02480002928225-1-4.wma

CWD is S:!DJ DAP\WIP Mp3tag curtain repath\Curtains\

EDIT: It seems ....\ (and ..\ and .) work relative to the CWD, wheras formatstring with no \ works relative to the track. Not by design, surely??

---

<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:22pm UTC](https://community.mp3tag.de/t/repathing-in-an-action/9810/12 "2026-02-09T12:22:08Z")

</div>


