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 |
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.
| Parameter | Meaning | Effect |
| -h | help | Show help text. |
| -l | long name | <album> - <spor> - <artist> - <title> |
| -_ | underline | Make underline instead of space. |
| -8 | utf-8 | Convert extracted data to utf-8, interpreted as iso-8859-1. |
| -. | ./ | Move to current directory (e.g. remove dirname). |
| -p | pretend | Do not rename files, but pretend so. |
| -e | echo | Do nothing more than writing out extracted data. |
| -s | format-string | Treat next word as a template for assembling new filenames, and substitute the expressions below with the corresponding data: |
| Format specifier: | Meaning: |
| %l | album |
| %n | track |
| %a | artist |
| %t | title |
| %d | path without filename, `dirname` |
| %b | old filename without rest of path, `basename` |
| %e | end of filename not counting the dot. |
Download
