Newbie Question: Rename mp3

Started by dino.conte, May 17, 2013, 11:33:51 PM

Previous topic - Next topic

dino.conte

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


dino.conte

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/.. ??

dino.conte

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' .

dino.conte

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

dino.conte

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?

Phil Harvey

If the file name doesn't contain a slash ("/"), then it won't be moved to another directory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

dino.conte

The Tag "Track" contains als Slash, so i must live with it  ;)

Thank's for these great tool!!

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

dino.conte

That's great, thanks again Phil.

Dino