GNU/Linux Desktop Survival Guide
by Graham Williams
Automatic Tagging Tools
20190821 Suppose we have an audio file and want to add
metadata from the file name into the metadata information within the
file. In this first example, the track and title is extracted from
the filename, assuming a filename is something like
$ lltag --format %n_%t --sep _ --maj *.mp3
--majconverts the words of the title to uppercase first letter.
Another example, including an artist, and with blanks in the filename,
might be consructed to deal with a file name like:
'01 Bruno Simpson - Major Trouble.mp3':
$ lltag --format "%n %a - %t" --maj *.mp3
Each command will ask for confirmation each time.
To automatically rename files to match our proposed file naming scheme introduced in Section 8.1, for files based on the mp3 tags use lltag:
$ lltag * --mp3v2 --dry-run --yes --rename "%n_%t" --rename-min \ --rename-sep _ --rename-regexp "s/[\'\(\)]/_/"
--dry-runso that we can first check it will be doing the right thing before we actually rename the files.