699 artist name folders starting with The. Fast way to change them?

On Windows 10, Picard 2.10. Is there a quick way to take all the folders starting with The and rename them? Ie, The Ventures to Ventures, The and make Picard follow that convention when creating folders?

I definitely don’t want to manually edit the names of 699 folders.

I remember seeing something about that a while ago, where Picard had to have a special rule to ignore the group The The so it wouldn’t get stuck in a loop attempting to fix it.

  1. There is a file naming script which defines what the folder structure (with Move Files selected) and filename (with Rename Files selected) is going to be when you save an Album or Track. By changing this and enabling Move Files you can rename the directory according to an updated file naming script.

  2. There is a script function $swapprefix() which you can use to move prefixes like “A”, “An”, “The” to the end of a string.

    Note: This only works for English prefixes, and if you want it to handle e.g. French prefixes like “Le” and “La” as well, then you need to specify a list of prefixes that you want handled.

  3. Alternatively you can use e.g. %_albumartists_sort% instead of %albumartist% to achieve something similar but using the sort values stored in MusicBrainz instead of a swapped version of %albumartist%.

Note: If you need to use a sort version of the album name, for some reason this is neither stored in MusicBrainz nor automatically calculated by Picard and you need to put $set(albumsort,$swapprefix(%album%)) in a script to set it.

3 Likes

I add $swapprefix(%albumartist%) to the start of the Primary File Naming Script and the example

L:\Big Music Collection\The Beatles\Help!\07 Ticket to Ride.mp3

becomes

L:\Big Music Collection\Beatles, TheThe Beatles\Help!\07 Ticket to Ride.mp3

It also changes Various Artists to Various ArtistsVarious Artists

I assume it would do that to all artist names in the folders.

Something missing from the brief instruction example page on how to replace “The Artist” with “Artist, The” instead of prepending “Artist, The” to the folder name, and do nothing at all to folders for artists that don’t start with the defaults of A and The.

if you started with the basic filenaming script, your filenaming script should look something like this:

$if2($swapprefix(%albumartist%),$swapprefix(%artist%))/
$if(%albumartist%,%album%/,)
$if($gt(%totaldiscs%,1),$if($gt(%totaldiscs%,9),$num(%discnumber%,2),%discnumber%)-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

this should only effect artists that start with ‘The’ or ‘A’

1 Like

That works. :slight_smile: Dunno what it’ll do if I ever get any songs from The The.