# Needing help with \_directory function to move files

**URL:** https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896
**Category:** Support
**Created:** [September 12, 2024, 12:44am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896 "2024-09-12T00:44:38Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![wyldephang](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/b5e925/32.png) [@wyldephang](https://community.mp3tag.de/u/wyldephang)
#### Post date: [September 12, 2024, 12:44am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/1 "2024-09-12T00:44:38Z")

</div>

Hello,

This is my first post at the MP3Tag community forum, and I am a brand new user of the software. My situation is that I recently had to download my entire music collection off my iPod due to a total system crash (the iPod being the last remaining copy of these files, unfortunately). There are tens of thousands of tracks on my iPod, so doing anything manually or one-by-one is out of the question. Basically, I've managed to recover all the ID3 data from my tracks, so all the artists, albums, years, et al. are intact. In the process of moving everything off my iPod, everything ended up in one large directory. However, I like to organize my music collection into folders based on the following format: D:\ Music \ [Artist] \ [Year] - [Album]. This makes it easier for me to access my files from my explorer (I'm on Windows 11).

I downloaded MP3Tag because a Google search recommended it as a good tag editor to organize my files. I am running into a bit of a snag, however, with understanding _how_ to actually move files automatically from one folder to another. I first used the Convert \> Tag-Tag tool to move batches of files to a different directory. Under Tag-Tag, the Field was \_DIRECTORY and the Format String was D:\ Music \ %artist% \ %year% - %album%. Doing this only succeeded in moving all files to the same folder (based on the first file in the list). I read a few topics about using the Action tool to change based on \_DIRECTORY, and I tried creating an action to do the following: Format value "\_DIRECTORY" D:\ Music \ %artist% \ %year% - %album%. When I check the box for this action in my Action Groups window and hit Apply, nothing happens--no files move and there is no message on the screen to indicate any change. I realize I am probably doing something wrong or missing a step, so if anyone would be able to walk me through the process step-by-step, I would be very appreciative for the help.

---

<div class="post-metadata">

### Author: ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)
#### Post date: [September 12, 2024, 12:56am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/2 "2024-09-12T00:56:29Z")

</div>

You can't use `_DIRECTORY` for that as it will always only move or rename the directory the songs are in. And if all songs are in one directory, that directory may be moved or renamed, but the individual files are not sorted into new directories like you want.

Instead use Convert → Tag - Filename for this and enter your absolute path pattern there. Be aware tho that this leaves for example .jpg, .log, .cue etc. files behind.  
Another snag you might hit is that this might split compilation albums where each track has a different artist into many 1-song folders.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [September 12, 2024, 1:36am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/3 "2024-09-12T01:36:25Z")

</div>

> [@Casual\_Tea](#):
>
> Instead use Convert → Tag - Filename for this and enter your absolute path pattern there

> [@wyldephang](#):
>
> However, I like to organize my music collection into folders based on the following format: D:\ Music \ [Artist] \ [Year] - [Album].

Try a string like this to get what you are looking for (based on your example above plus some additional suggestions):  
`D:\Music\%albumartist%\%year% - %album%\$ifgreater(%totaldiscs%,1,$left(%discnumber%,2)-,)$num(%track%,2) %title%`

You can also use the Action\>Format Value with this same string.

> [@Casual\_Tea](#):
>
> Another snag you might hit is that this might split compilation albums where each track has a different artist into many 1-song folders.

Use the AlbumArtist field instead of Artist to help prevent this from happening. You may also want to reconsider including the Year field in the directory if you have used different year values within any single Album.

> [@Casual\_Tea](#):
>
> Be aware tho that this leaves for example .jpg, .log, .cue etc. files behind.

This could be a problem in some cases. But given this particular issue is restoring info from an iPod it is unlikely to have any impact. Those folders only contain music files that have been renamed. But fortunately the metadata remains intact.

---

<div class="post-metadata">

### Author: ![wyldephang](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/b5e925/32.png) [@wyldephang](https://community.mp3tag.de/u/wyldephang)
#### Post date: [September 12, 2024, 2:10am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/4 "2024-09-12T02:10:16Z")

</div>

I appreciate the assistance, everyone. I used the Convert \> Tag - Filename function and moved all the files this way. There aren't many compilation albums on my iPod, and the ones that I do have are organized by artist name anyway rather than album (resulting in more than one instance of said album). I'm happy with the result, so thank you very much!

---

<div class="post-metadata">

### Author: ![1HotJob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/f0a364/32.png) [@1HotJob](https://community.mp3tag.de/u/1HotJob)
#### Post date: [September 12, 2024, 8:15pm UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/5 "2024-09-12T20:15:02Z")

</div>

> [@MotleyG](#):
>
> Try a string like this to get what you are looking for (based on your example above plus some additional suggestions):  
> `D:\Music\%albumartist%\%year% - %album%\$ifgreater(%totaldiscs%,1,$left(%discnumber%,2)-,)$num(%track%,2) %title%`

I'm sorry, you lost me. What would I select to put that string into? I have been using a program I recently found called Tags to Folders. I would like to do it within MP3Tag if possible.

---

<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 12, 2024, 8:20pm UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/6 "2024-09-12T20:20:53Z")

</div>

See the documentation:

> **[Rename Files – Mp3tag Documentation](https://docs.mp3tag.de/converters/rename-files/)**
>
> Documentation on Tag to Filename, a converter to rename files based on tags. Mp3tag is the universal Tag Editor.

and also in this thread:

> [@wyldephang](#):
>
> I used the Convert \> Tag - Filename function

---

<div class="post-metadata">

### Author: ![1HotJob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/f0a364/32.png) [@1HotJob](https://community.mp3tag.de/u/1HotJob)
#### Post date: [September 13, 2024, 1:29pm UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/7 "2024-09-13T13:29:54Z")

</div>

![image](https://community.mp3tag.de/uploads/default/original/3X/8/c/8c976c25bd61b6263fbada1a3f79322eb7ece135.png)  
I don't understand how "Convert" "Tag - Filename" moves anything. I use it to rename the filename with the Artist and Title, but that is it.

---

<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: [September 13, 2024, 1:36pm UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/8 "2024-09-13T13:36:02Z")

</div>

That works fine, if you add a **%** character after your %artist like this:  
`%artist%`

![image](https://community.mp3tag.de/uploads/default/original/3X/5/1/512d5a9b528c7ce72a155a31012ed6ec8ca4bdb1.png)

---

<div class="post-metadata">

### Author: ![1HotJob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/f0a364/32.png) [@1HotJob](https://community.mp3tag.de/u/1HotJob)
#### Post date: [September 13, 2024, 7:51pm UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/9 "2024-09-13T19:51:55Z")

</div>

Thank you very much. Those "%" signs throw me off. I forget one every now and then.

---

<div class="post-metadata">

### Author: ![1HotJob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/f0a364/32.png) [@1HotJob](https://community.mp3tag.de/u/1HotJob)
#### Post date: [September 13, 2024, 10:56pm UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/10 "2024-09-13T22:56:43Z")

</div>

Okay, my last post to this thread. I can't tell you how thankful I am. I had a DJ business with multiple backups. I am putting all the songs on my server, but am sorting by "artist/year album/artist - title" in A-Z folders. With your help, I am able to load all of the A artists and move them to the A folder without going through the hassle of looking into each folder to see if it has the album already in there. You have saved weeks of work. Thank you, Than you, Thank you.

---

<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 14, 2024, 6:06am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/11 "2024-09-14T06:06:41Z")

</div>

> [@1HotJob](#):
>
> but am sorting by "artist/year album/artist - title" in A-Z folders. With your help, I am able to load all of the A artists and move them to the A folder

You could automate even that if you insert a  
`$left(%artist%,1)\` in front of the part where you start with the ARTIST name.

---

<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: [October 14, 2024, 6:07am UTC](https://community.mp3tag.de/t/needing-help-with-directory-function-to-move-files/65896/12 "2024-10-14T06:07:32Z")

</div>

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