GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Tagging MP3 files from filesystem names

This is a button to tag MP3 files basing on MP3 file name and directory name.
It is useful when you have perfectly named collection in file system structure, but not tagged.

Prerequisites:

  • id3 tagging tool which can be found here. (Edit: See Kundal's reply below if the link is still broken.)

Assumptions:

  • The id3 tool in path C:\Programy\id3\

  • Button is to be run with a directory with MP3 files to be tagged as active (source) directory.

  • Directory structure:

    Artist name [year] Album name\Track_number Track title.mp3
    

    For example:

    Dol Ammad [2010] Winds Of The Sun (EP)\1 Winds Of The Sun.mp3
    

    (and, of course, rest of the files to be tagged.)

  • Only v2 tags are set.

  • Genre chosen by hand.

Button:

<?xml version="1.0"?>
<button backcol="none" display="label" textcol="none">
	<label>Tag MP3 from filename</label>
	<icon1>#newcommand</icon1>
	<function type="normal">
		<instruction>@runmode hide</instruction>
		<instruction>@set genre=&quot;{dlgchoose|Select genre|Metal+More Metal+Even More Metal+Rock}&quot;</instruction>
		<instruction>cmd /V:ON /C FOR /F %Q IN (&apos;dir /b *.mp3^|find /c /v &quot;&quot;&apos;) DO FOR /F &quot;delims=[]; tokens=1,2,3&quot; %D in ({sourcepath|nopath|noterm}) DO set ART=%D&amp;set ALB=%F&amp; c:\programy\id3\id3 -M -2 -g {$genre} -a &quot;!ART:~0,-1!&quot; -y &quot;%%E&quot; -l &quot;!ALB:~1!&quot; -n %%1/%Q -m &quot;* %%t.mp3&quot;</instruction>
	</function>
</button>

The Grisly Command Line, Featuring Some Obscure CMD Features:

cmd /V:ON /C FOR /F %Q IN ('dir /b *.mp3^|find /c /v ""') DO FOR /F "delims=[]; tokens=1,2,3" %D in ({sourcepath|nopath|noterm}) DO set ART=%D&set ALB=%F& c:\programy\id3\id3 -M -2 -g {$genre} -a "!ART:~0,-1!" -y "%%E" -l "!ALB:~1!" -n %%1/%Q -m "* %%t.mp3"

Have fun!

looks interesting...
anyone figured out how to use the -wTYPE switch?
i tried x variations to set some TXXX frames without any success and i can't find any help about the format of the data.

thnx for help...

The "ID3 Mass Tagger" Tool is no longer available from the Link in Xyzzy's first post.
I uploaded the original Zipfile to the forum to make it available again:

id3-078w.zip (87.0 KB)

[quote="klUS7ER"]looks interesting...
anyone figured out how to use the -wTYPE switch?
i tried x variations to set some TXXX frames without any success and i can't find any help about the format of the data.

thnx for help...[/quote]

The id3 program cannot properly set TXXX. I use metamp3 for this:

C:\Programy\metamp3\metamp3.exe --2 --frame TXXX["ARTIST COUNTRY"]:{$country} "*.mp3"