batchid3v2 is a program to tag and rename a group of audio files in batch mode. I wrote it to organize my music collection at a time when there weren't many programs that supported id3v2 on Linux.
Documentation (from the file's comments):
This program is just a quick hack, if you don't have the file list format
exactly correct it will probably fail, and possibly destroy the files that you
were working on (heck, it may even do that if the file list format is perfect).
You've been warned.
batchid3v2 accepts the following commandline arguments:
-f filename (the name of the file containing the id3v2 information)
-r pattern (rename the tagged files according to the supplied pattern)
-s (allow spaces)
-n (don't number tracks)
-d (remove id3v1 tags)
-3 (create id3v2.3.0 tags)
the track filenames
If the -f option is not specified batchid3v2 will look for the file named
.id3v2info
If the -r option is given batchid3v2 will rename the file after tagging it.
If the -a option is given spaces will not be converted to underscores.
If the -n option is given the files will not be tagged with track numbers
(useful if the files are not in order by track).
NOTE: If you have a filename that begins with '-' be sure to use an empty flag
('--' by itself) to mark the end of options. It's generally a good practice to
do this all the time.
The format of the rename pattern is string of field tokens and normal
characters. The available field tokens are:
%# (track number, not available with -n)
%= (total number of tracks, not available with -n)
%T (track title)
%A (track artist; the band, composer, and lead artist fields are examined)
%R (record or album title)
%G (genre)
%L (language)
%F (filetype; mp3, ogg, etc)
%C (comment; you probably don't want to use this one, but I leave it here in case you want to shoot yourself in the foot)
When renaming files, spaces are automatically converted to underscores. Use the
-a (allow whitespace) flag to override this behavior.
Example command lines:
batchid3v2 some_song.mp3 another_song.mp3
(uses .id3v2info and doesn't rename the files)
batchid3v2 -r "%#-%A-%T.%F" -- *.ogg
(uses .id3v2info and renames the files in the form
tracknumber-artist-title.filetype)
batchid3v2 -s -f FILELIST -r "%A - %R - %# of %=.%F" -- *.mp3
(uses FILELIST, renames the files in the form artist - album - tracknumber of
totaltracks.filetype, and doesn't turn any spaces into underscores)
The file format (plain ASCII) is as follows:
- header
- tracks
The header may contain one of each of the following lines:
composer (obvious)
band (the artist)
artist (the solo or lead artist)
album (record title)
genre, content (just use one, they're the same)
language (in ISO-639-2 form)
filetype (i.e. mp3, ogg, etc)
comment (whatever you can fit on one line!)
The format of a header line is:
type: value
The tracks are specified on separate lines after the header. For all practical
purposes the track titles are freeform, but be aware that strange characters in
the track titles can give your filesystem problems if you're using the rename
file option. If a track line contains the character '/' then all characters
after it are interpreted as a subtitle (i.e. instrumental, 1st mix, etc).
Notes: Blank lines are ignored but whitespace is important. There's currently a
256 character limit on the lines in the file, if you need to change this edit
LINE_SIZE.