Replacing underscores with spaces in music file paths

bliss's default file organisation patterns replace whitespace with underscores. The reason for this is simple: it's how I like it. replacing spaces with underscores helps with scripting and command line control of your music files, and as I am a Linux user and command line enthusiast this works for me.

However, not everyone is this... weird... and to many the aesthetic appearance of their filenames matter more. I can't claim that using underscores is any more beautiful than spaces; I recognise the opposite is the case and to many underscores may appear downright ugly.

While preserving spaces is not the default for bliss, it's easy to configure using a custom file organisation pattern. These custom patterns give full control over for and folder names.

Indeed, even default patterns use custom patterns under the covers. This is the best place to start with custom patterns. Imagine you wanted to use the default pattern artist/album/tracknumber-trackname. With this already set as the pattern, change the pattern to Custom. The custom pattern text field will appear and be populated with:


When run, bliss takes each token surrounded by < and > in the pattern and replaces it with the requisite metadata for each album before assessing compliance and (potentially) fixing the path. Here's bliss's assessment:

Non compliant showing requirement for underscore

Ok, so as expected the Expected path contains underscores. Here's the clever bit: the whitespace separator is defined by the character between the words in textual tokens. The whitespace can either be an underscore (as above), a hyphen, zero length or (pertinently) a space.

So, changing the pattern to this derives our desired result:

<artist name>/<album name>/<tracknumber>-<track name>

And when assessed:

Non compliant showing requirement for spaces

Nice! Now it's just a case of clicking to fix:

Now compliant with spaces

Job done!

Thanks to psd for the image above.
tags: file org

The Music Library Management blog

Dan Gravell

I'm Dan, the founder and programmer of bliss. I write bliss to solve my own problems with my digital music collection.