# How to change a file's folder path based on file name?

**URL:** https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764
**Category:** General Discussion
**Created:** [March 29, 2015, 3:37pm UTC](https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764 "2015-03-29T15:37:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bmacd615](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bmacd615](https://community.mp3tag.de/u/bmacd615)
#### Post date: [March 29, 2015, 3:37pm UTC](https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764/1 "2015-03-29T15:37:54Z")

</div>

1. I ripped a 70 CD set of Cantatas into folders (e.g.: C:\CD1, C:\CD2, C:\CD3.....).
2. Each CD has about 3 cantatas. For example CD1 contains BWV1, BWV2 and BWV3.
3. I have separately created folders for each cantata (C:\Cantatas\BWV1, C:\Cantatas\BWV2, C:\Cantatas\BWV3)

How can I move each BWV# to it's folder? I'm doing it manually now, but I have 3 versions of these kantaten.

Attached is a screenshot of my mp3tag contents.  
(For simplicity in explaining, I simplified the folder names in the three steps listed above. Each BWV# is also followed by the composition title.)

OR PARTIALLY ACCEPTABLE:  
How can I renumber each track (say 1 to 5) for each BWV# file? I see there is an option to renumber based on each CD directory.

 ![](https://community.mp3tag.de/uploads/default/original/2X/f/f87c3d38fa60b49e871912057e2994ffe162e4f6.png)

---

<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 29, 2015, 3:53pm UTC](https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764/2 "2015-03-29T15:53:01Z")

</div>

I do not know what a BWV is ...  
But as you have it as a field (I see it in the screenshot), you can use the function  
Convert-Tag-Filename:  
Format string: C:\Cantatas\%BWV%\%\_filename%

This should move the audio files but leaves you with a number of empty folders.

---

<div class="post-metadata">

### Author: ![bmacd615](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bmacd615](https://community.mp3tag.de/u/bmacd615)
#### Post date: [March 29, 2015, 8:47pm UTC](https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764/3 "2015-03-29T20:47:56Z")

</div>

Fantastic! I wasn't sure I could get that functionality out of the Convert function when I first looked at it. You (and Florian and Mp3tag) have saved me hours!

I have attached another screenshot of the convert - tag - filename as I used it. This created the folder and contents I wanted. Therefore I did not need to use the named folder set I had created in step 3 above (using an excel macro).

Thanks,

Bruce

 ![](https://community.mp3tag.de/uploads/default/original/2X/2/2715dde82c73a6ddf48b9f48ccc4217cec1c771a.png)

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [March 30, 2015, 3:56am UTC](https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764/4 "2015-03-30T03:56:32Z")

</div>

> [@ohrenkino](#):
>
> I do not know what a BWV is ...

So that you will not stay uninformed for the rest of your life. 😉  
[http://de.wikipedia.org/wiki/Bach-Werke-Verzeichnis](http://de.wikipedia.org/wiki/Bach-Werke-Verzeichnis)

---

<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 30, 2015, 5:39am UTC](https://community.mp3tag.de/t/how-to-change-a-files-folder-path-based-on-file-name/16764/5 "2015-03-30T05:39:26Z")

</div>

> [@poster](#):
>
> So that you will not stay uninformed for the rest of your life. 😉  
> [http://de.wikipedia.org/wiki/Bach-Werke-Verzeichnis](http://de.wikipedia.org/wiki/Bach-Werke-Verzeichnis)

Aaaah! Thank you!
