ID3CL is a tiny C++ application that lets you change the ID3 tags of an MP3 file. ID3CL is used only from the command-line and as such it can be used very easily from a scripting environment.

While retagging my music collection I found myself wishing that I could write a small application that could quickly retag my MP3 in a certain way(s). So I created this small application that I could call from a scripting environment. I use Windows PowerShell, but you could use anything else that can call other executables.

This sort of thing is useful for situations similar to this: you've got a bunch of MP3s that are correctly ordered by filename, but their track numbers are all messed up. For this example, you'd create a short script that'd loop through each of those MP3s in alphabetical order and execute ID3CL for each file telling it to change the track number to a number which you start from one and increment for each MP3 file you process. That's a simple example and there are sometimes a lot more complex situations that can arise where only the direct control over retagging that scripting + ID3CL gives you can solve.

You should note that ID3CL is me-ware. This means I made it for myself. It's not properly tested, and it doesn't handle errors and weird situations well. For example, if you get ID3CL to retag a file that doesn't exist it will create a blank file and write the MP3 tags into it. It will not error at all. That said, so long as you give it sensible command-line arguments it should not just crash. Use it carefully and it should work okay for you.

Behind the scenes, ID3CL uses (but does not modify) the ID3Lib open source library to manipulate ID3 tags in an MP3. ID3Lib is licenced under the LGPL v2.


Latest Version: v1.0.0 Alpha
Last Updated: 2007/08/10
Platform: Windows
Size: 190KB
Download: ZIP

How to Use ID3CL

ID3CL's command-line arguments work like this:

Usage: id3cl <mp3 filename> -set <fieldname> <value> [-set <field name> <value> [..]]

Fields: tracknum, artist, album, title, year, comment, genre

So, if you wanted to change the artist of song.mp3 to "DJ DC", the title to "Lunch with rocks", the track number to one and the genre to "Weird", you would run this at the command-line:

id3cl song.mp3 -set artist "DJ DC" -set title "Lunch with rocks" -set tracknum 1 -set genre "Weird" 

You can pick and choose which tags you'd like to change. So if you only wanted to change the track number to 36 you'd run this:

id3cl "C:\My Music\song.mp3" -set tracknum 36

Scripting with ID3CL

The real power of id3cl comes in when you use a script or some other program to automate things. I personally use PowerShell to script. I'll give a short example of a PowerShell script for ID3CL.

Imagine you had an album that was spread across two CDs. Each disc had 20 tracks. You rip the two discs to MP3 and your ripper tags the tracks from disc 1 with track numbers from 1 to 20, tags disc 2's tracks with track numbers from 1 to 20. This is wrong (well, I think it is)! You want the track numbers on disc 2 going from 21 to 40. But, who wants to change those twenty track numbers themselves? Okay, admittedly twenty track numbers probably isn't too bad, but I've have instances where I've needed to do over a hundred tracks. Run with the example, okay? :)

The files from each disc are in separate folders named CD1 and CD2 and each MP3 file name is prefixed with the track number. So your file structure looks like this:

DJ DC Mix 2007 
  |- CD1
  |  |- 01.Lunch.With.Rocks.mp3
  |  |- 02.Dinner.With.Timber.mp3 
  |  ...
  |  |- 20.Brunch.With.Steel.mp3 
  |- CD2
     |- 01.Breakfast.With.Plastic.mp3
     |- 02.Afternoon.Tea.With.Silicon.mp3 
     |- 20.Late.Night.Snack.With.ReardenMetal.mp3 

By creating the below PowerShell script in the "DJ DC Mix 2007" folder and running it, you can quickly and automatically retag the MP3s so that the track numbers go from 1 to 40.

$id3cl = "& 'C:\Program Files\ID3CL\id3cl.exe' "

$mp3s = Get-ChildItem * -Include *.mp3 -Recurse

$tracknum = 1

foreach ($mp3 in $mp3s)
    $cmdline = '"' + $mp3.FullName + '" -set tracknum ' + $tracknum
    Invoke-Expression ($id3cl + $cmdline)
    if ($tracknum -eq 256)
        $tracknum = 1