Namebytag

Namebytag is a flexible renaming tool that renames files based on their metadata. It uses Taglib, which can extract metadata from mp3 (id3 1 and 2), ogg vorbis and FLAC. The standard generated filename has the form "<artist> - <title>.end", where the end is kept unchanged from the old filename. The string between artist and title will only be there if both artist and title are known. If the new name is already in use, a string of the form " (n)" is inserted in front of the dot at the end, where n is an integer that goes from 0 and up until the filename is unique. Namebytag can also do lots more, see example.

Source code: very C-like C++
License: Nutshell Freedom Lisence
Statically linked library: Taglib
Author: Andreas Nordal
Tested on: Linux 2.6.11-6mdk, Linux 2.6.17, taglib-1.4, gcc-4.1.2

Example

Suppose we had enough bad luck to have these filenames:
bash.mp3	dirt.ogg	lort.flac
bush.mp3	dust.ogg	ruke.flac
Such names of four letters can typically be found on an iPod. To tide up, we can open the files in namebytag. The easiest way is probably to right click them and somehow select to open them with namebytag. From the command line, you have more options (see parameters), the rest is described in the builtin help text. If you are familiar with your shell, then you know that you can use it to match several paths for you by using wildcard characters; for example * expands to all files in the directory. Use of some parameters are also shown below:
bash-3.1$ namebytag -l bash.mp3
- bash.mp3
+ Absolute music 23 - 03 - Infinity - Happy.mp3
bash-3.1$ namebytag -_ b* d*
- bush.mp3
+ Mauro_Picotto_-_Komodo.mp3
- dirt.ogg
+ Gigi_D'Agostino_-_La_Passion.ogg
- dust.ogg
+ Gigi_D'Agostino_-_Sara_Perche_ti_Amo.ogg
bash-3.1$ namebytag -s "%l/%l %n -%a- %t" *.flac
- lort.flac
+ Goliath '06/Goliath '06 05 -Casseopaya- Overdose.flac
- ruke.flac
+ Goliath '06/Goliath '06 07 -Commander Tom- Are Am Eye.flac
The two .flac files were moved to another directory because of the slash in the format string. If the directory did not exist, Namebytag created it. To avoid this from happening accidentally, slashes from the metadata trying to get into the path are substituted with + signs.

Parameters

ParameterMeaningEffect
-hhelpShow help text.
-llong name<album> - <spor> - <artist> - <title>
-_underlineMake underline instead of space.
-8utf-8Convert extracted data to utf-8, interpreted as iso-8859-1.
-../Move to current directory (e.g. remove dirname).
-ppretendDo not rename files, but pretend so.
-eechoDo nothing more than writing out extracted data.
-sformat-stringTreat next word as a template for assembling new filenames, and substitute the expressions below with the corresponding data:
Format specifier:Meaning:
%lalbum
%ntrack
%aartist
%ttitle
%dpath without filename, `dirname`
%bold filename without rest of path, `basename`
%eend of filename not counting the dot.

Download

Souce code:Published:
namebytag-0.8.a.tar.gz ] 10/10 2007

Valid XHTML 1.0 Strict