# How can I file my songs separately into their own folders alphabetically? ignoring prefix's?

**URL:** https://community.metabrainz.org/t/how-can-i-file-my-songs-separately-into-their-own-folders-alphabetically-ignoring-prefixs/136327
**Category:** MusicBrainz Picard
**Created:** [September 19, 2016, 5:03am UTC](https://community.metabrainz.org/t/how-can-i-file-my-songs-separately-into-their-own-folders-alphabetically-ignoring-prefixs/136327 "2016-09-19T05:03:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amberln](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/a/c37758/32.png) [@amberln](https://community.metabrainz.org/u/amberln)
#### Post date: [September 19, 2016, 5:03am UTC](https://community.metabrainz.org/t/how-can-i-file-my-songs-separately-into-their-own-folders-alphabetically-ignoring-prefixs/136327/1 "2016-09-19T05:03:47Z")

</div>

Im trying to find a way to put files into directories alphabetically. So for instance: I have a folder called “B” all Beatles files go into there. A folder called “C” all The Cult files into there, and etc etc.

My biggest issue is though, I would it to ignore prefix’s like, The, A, Of, etc. So in the example above, The Beatles would go into a directory of B, Not T as in "The Beatles.

Thanks for the help as always!!

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [September 19, 2016, 7:44am UTC](https://community.metabrainz.org/t/how-can-i-file-my-songs-separately-into-their-own-folders-alphabetically-ignoring-prefixs/136327/2 "2016-09-19T07:44:21Z")

</div>

Try this script snippet for the directory part:

```taggerscript
$firstalphachar($if2(%albumartistsort%,%artistsort%))/

```

The following discussion about the sortname vs `$swapprefix()` might also be interesting:

> [@How to move the word "The" to after the artist?](https://community.metabrainz.org/t/how-to-move-the-word-the-to-after-the-artist/135585):
>
> I searched, I couldnt find a simple solution to move the word “The” after the artist. i.e. The Beatles becomes, Beatles, The. Its all I want to do, its something probably along the lines of: $replace($if($eq($left(%albumartist%,4),The ) but that doesnt work frowning a Pre-Thank you for the help!

---

<div class="post-metadata">

### Author: ![CallerNo6](https://community.metabrainz.org/user_avatar/community.metabrainz.org/callerno6/32/39_2.png) [@CallerNo6](https://community.metabrainz.org/u/CallerNo6)
#### Post date: [September 19, 2016, 2:43pm UTC](https://community.metabrainz.org/t/how-can-i-file-my-songs-separately-into-their-own-folders-alphabetically-ignoring-prefixs/136327/3 "2016-09-19T14:43:19Z")

</div>

A similar scenario is covered in the [Picard docs](http://picard.musicbrainz.org/docs/scripting/#organize_by_alphabetical_folders_excluding_leading_the).

You’ll need to tweak it to get exactly what you’re looking for. Among other things (as outsidecontext points out) it uses `artistsort` rather than `$swapprefix`.
