ExifTool Forum

ExifTool => Newbies => Topic started by: dino.conte on May 17, 2013, 11:33:51 PM

Title: Newbie Question: Rename mp3
Post by: dino.conte on May 17, 2013, 11:33:51 PM
Is there a way to rename mp3 files, including generation of folders from the Tag with exiftool (i use Linux)?

Example: The file "imagine,mp3" has the Tag "Artist: John Lennon", Album "Gimme Some Truth", Title "Imagine", Track "15" and is saved in /downloads/imagine.mp3

Ich will get the output:  /John Lennon/Gimme Some Truth/15 - Imagine.mp3

I have found nothing about this in the documentation ...

Many Greetings,
Dino

Title: Re: Newbie Question: Rename mp3
Post by: dino.conte on May 18, 2013, 03:43:38 AM
I found this:

exiftool -ext MP3 '-Directory<Artist' .

Alternatively, for recursive processing:
exiftool -r -ext MP3 '-Directory<Artist' .

And - it works beautifully!

But, how do I get a directory structure such as /Artist/Album/.. ??
Title: Re: Newbie Question: Rename mp3
Post by: dino.conte on May 18, 2013, 04:08:33 AM
All questions answered by me  ;D

I forgot the "$".

So everything is working fine:

exiftool -ext MP3 '-Directory<$Artist/$Album' .

Respectively, for recursive cycle:
exiftool -r -ext MP3 '-Directory<$Artist/$Album' .
Title: Re: Newbie Question: Rename mp3
Post by: dino.conte on May 18, 2013, 06:15:15 AM
Regardless of the above, how can I use multiple Tags for the renaming of the file name?

I.E. i have "lennon.mp3", the Tags are "Artist=Lennon", "Title="Imagine", "Track=02".
How can i rename the file to "02 - Lennon - Imagine.mp3" (in the same directory)?

exiftool '-filename<$Track$Artist$Title.%e' lennon.mp3 is not properly ...  :'(

with one Tag it Works great:

exiftool '-filename<$Title.%e' lennon.mp3  :D
Title: Re: Newbie Question: Rename mp3
Post by: Phil Harvey on May 18, 2013, 06:44:37 AM
Hi Dino,

Quote from: dino.conte on May 18, 2013, 06:15:15 AM
exiftool '-filename<$Track$Artist$Title.%e' lennon.mp3 is not properly ...  :'(

This should work, provided the Track, Artist and Title tags exist and don't contain illegal characters.

- Phil
Title: Re: Newbie Question: Rename mp3
Post by: dino.conte on May 18, 2013, 08:13:18 AM
Hi Phil,

and thanks for your answer!

It works, but move the renamend file in a new created folder, can i have the file at the same place?
Title: Re: Newbie Question: Rename mp3
Post by: Phil Harvey on May 18, 2013, 08:18:59 AM
If the file name doesn't contain a slash ("/"), then it won't be moved to another directory.

- Phil
Title: Re: Newbie Question: Rename mp3
Post by: dino.conte on May 18, 2013, 08:41:54 AM
The Tag "Track" contains als Slash, so i must live with it  ;)

Thank's for these great tool!!
Title: Re: Newbie Question: Rename mp3
Post by: Phil Harvey on May 18, 2013, 08:22:44 PM
Hi Dino,

You don't have to live with anything you don't want to.

Do this in your expression to remove the slash: ${track;}

The semicolon invokes the advanced formatting feature, and without an expression the default is to remove / \ ? * : | < and >.

- Phil
Title: Re: Newbie Question: Rename mp3
Post by: dino.conte on May 18, 2013, 10:45:44 PM
That's great, thanks again Phil.

Dino