GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Tagging Automatically Audio Files |
20190821 To add metadata from the file name into the
metadata information within the file the lltag command
comes in handy. In this first example, the track and title is
extracted from the filename, assuming a filename is something like
01_paradise_today.mp3
, with the title capitalised:
$ lltag --dry-run --format %n_%t --sep _ --maj *.mp3 |
--maj
converts 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 10.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-run
so that we can first check it
will be doing the right thing before we actually rename the files.