Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go

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
The --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/[\'\(\)]/_/"
Notice the use of --dry-run so that we can first check it will be doing the right thing before we actually rename the files.


Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.