Format Item with tabs

Right now my format config item is:
format_item: $albumartist - $original_year - $album - $title - $length - $speaker_matrix - $rating

This gives me the output:
菅野よう子 - 2009 - Darker Than Black Original Soundtrack 5.1 - Kuro - 3:37 - 5.1 channel surround - $rating
菅野よう子 - 2009 - Darker Than Black Original Soundtrack 5.1 - Dadly Work - 3:35 - 5.1 channel surround - $rating
菅野よう子 - 2009 - Darker Than Black Original Soundtrack 5.1 - Tentaikansoku - 0:46 - 5.1 channel surround - 100.0

which given the number of fields looks a mess. It there a way that I can include tabs to column-ize it?

Colors would be awesome too, but that’s for another day.

The common Unix utility column is probably what you want here! For example:

$ echo 'foo - bar\na - b' | column -t -s -                                    ~
foo    bar
a      b
1 Like

Column! I remember now, thank you! (I’ve been using bash since 2000, why do I keep forgetting commands?)

That works well on the command line. I assume that beets applies the config in such a way that there’s no way to invoke column from the config file, and that I’d have to do enact this in a script, yes?

Yep, that’s right!

You could also use %ifdef{rating,[$rating],} if you want to avoid printing “$rating” when that field is empty. :slight_smile:

1 Like