#1 2017-06-23 23:16

JoeSpeaksEnglish
Member
Registered: 2017-06-23
Posts: 5

How To Add Custom Filename to MP3 file automatically?

Hello everyone smile

I've used Renamer for awhile now. I love it.

I have lots of mp3 files that I want to edit and I'd like to do it efficiently to save time.

I want to edit in this format:

'Artist - title (album)(year)'

Here we go....

The folder name looks like this:

"1996 - 18 Til I Die"

The Mp3 filename looks like this:

"02. Have You Ever Really Loved A Woman.mp3"

How do I get the folder name to look like this in Renamer?

"Bryan Adams - Have You Ever Really Loved A Woman (18 Til I Die)(1996).mp3"

What do I use Pascal script? User Input? What do I use to automate the process for hundreds of mp3 files?

Any help would be appreciated! Thanks for taking the time to read my post and I hope to hear from you guys soon smile

Offline

#2 2017-06-24 15:46

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: How To Add Custom Filename to MP3 file automatically?

Hello,

If your MP3 files contain ID3 tags, then you can do that with a single Insert rule:

Insert ":MP3_Artist: - :MP3_Title: (:MP3_Album:) (:MP3_Year:)" replacing current name (skip extension)

If ID3 tags are not available, then you can use the parent folder name and a bit of RegEx. But first, check if the approach above works.

Offline

#3 2017-06-27 02:03

JoeSpeaksEnglish
Member
Registered: 2017-06-23
Posts: 5

Re: How To Add Custom Filename to MP3 file automatically?

That was AWESOME!!!

Thank you for that. That saved me a lot of time. I haven't been using Renamer's full potential sad I've just been using the basics only.

Can you please show me the RegEx code? I do come across a lot of music without ID3tags. I usually use a 3rd party software to add ID3tags then use Renamer after.

Offline

#4 2017-06-27 07:26

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: How To Add Custom Filename to MP3 file automatically?

JoeSpeaksEnglish wrote:

...Can you please show me the RegEx code? ...

For that all of your file names must follow the same pattern,
like: <##> <artist> - <title>.<ext>

If your file names have different pattern, you have to adjust them first,
or define different RegEx expressions for different pattern rules.

Next find common anchor points (like: "first one or two digits", "till second space", "before last hyphen")
where we can build an regular expression for.




So please provide a few before/after examples:


Before:
1996 - 18 Til I Die\02. Have You Ever Really Loved A Woman.mp3

After:
1996 - 18 Til I Die\Bryan Adams - Have You Ever Really Loved A Woman (18 Til I Die)(1996).mp3



Where does the artist name came from?






Perhaps you have:

Before:
X:\Music\Bryan Adams\1996 - 18 Til I Die\02. Have You Ever Really Loved A Woman.mp3

After:
X:\Music\Bryan Adams\1996 - 18 Til I Die\Bryan Adams - Have You Ever Really Loved A Woman (18 Til I Die)(1996).mp3



Then use this rules:

1) Delete: Delete from Position 1 until the End (do NOT skip extension) [remove old name completely]
---

2) Insert: Insert ":File_FilePath:" as Prefix (skip extension) [insert whole path, to get all folder names]
X:\Music\Bryan Adams\1996 - 18 Til I Die\02. Have You Ever Really Loved A Woman.mp3

3) Regular Expressions: Replace expression "^.+Music\\" with "" (skip extension) [remove unneeded first part of the path]
Bryan Adams\1996 - 18 Til I Die\02. Have You Ever Really Loved A Woman.mp3

4) Regular Expressions: Replace expression "^(.+)\\(\d{4}) - (.+)\\....(.+).mp3" with "$1 - $4 ($3)($2)" (skip extension)
[pick the wanted parts, store and reorder them to build wanted new name]
Bryan Adams - Have You Ever Really Loved A Woman (18 Til I Die)(1996).mp3

Explanation:
- match all till backslash and store in "variable" $1 (Bryan Adams)
- match four digits (1996) > $2
- space,hyphen, space
- match all till backslash (18 Til I Die) > $3
- match four signs (02. )
- match the rest (Have You Ever Really Loved A Woman) > $4



See our wiki what that all means:
http://www.den4b.com/wiki/ReNamer:Rules:RegEx
http://www.den4b.com/wiki/ReNamer:Regular_Expressions 




Again, if your file names have another pattern order, that RegEx may not match correctly any more.


And keep in mind that RegEx may not always really match what you think it would, so please double check before clicking on Rename.





 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#5 2017-06-30 04:09

JoeSpeaksEnglish
Member
Registered: 2017-06-23
Posts: 5

Re: How To Add Custom Filename to MP3 file automatically?

Hi Stefan,

Thank you for taking the time to respond to my question smile Much appreciated!

To answer one of your questions:

"Where does the artist name came from?"

The artist info comes from the mp3tags that's already correctly entered.

The Regex stuff seem to me very complicated.... sad

I'll play with it more and follow your examples religiously and read the manual further.

I do have another question regarding the first post that den4b answered for me...

I'm using the rule:
Insert ":MP3_Artist: - :MP3_Title: (:MP3_Album:) (:MP3_Year:)"

What I'm doing now is dragging and dropping the folder & mp3files into the "Files Pane" and then clicking the "Rename" button and I'm renaming one folder at at time. After it's renamed I highlight all the files in the "Files Pane" and click "Remove Selected" to drag the next folder to be renamed.

To save me some time.. is there a trick to automatically clear the list in the "Files Pane" after the renaming is finished?

As I was browsing the forum I think remembered another member asking something similar.

Please let me know smile Thanks.

Offline

#6 2017-06-30 14:20

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: How To Add Custom Filename to MP3 file automatically?

You would need to use Regular Expressions or Pascal Script only if you don't have ID3 tags in your MP3 files. However, even then you will still need to have all the necessary components (artist, title, year, etc) in the path of the MP3 file, otherwise, no magic rule will help you guess a correct artist, for example.

In short, you should ensure that all MP3 files do have ID3 tags. You could use something like Mp3tag to batch edit ID3 tags. Then you can rely on a simple reaming rule using meta tags.

You can clear all files with a click via the context menu or Ctrl+Del shortcut.

ReNamer can automatically clear successfully renamed files if you enable the relevant option in the Settings.

Offline

#7 2017-07-04 05:28

JoeSpeaksEnglish
Member
Registered: 2017-06-23
Posts: 5

Re: How To Add Custom Filename to MP3 file automatically?

Thanks  d

I played with the auto clear after the successful rename.

Is this correct?:
Settings>Rename Tab>Clear rename files on rename (checkbox)

Also, I do use Mp3tag to batch edit and add the artist, title, track, etc. first before using Renamer to rename the name of the .mp3 file.

Offline

#8 2017-07-07 15:45

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: How To Add Custom Filename to MP3 file automatically?

JoeSpeaksEnglish wrote:

Is this correct?:
Settings>Rename Tab>Clear renamed files on rename (checkbox)

Yes, that's the one you want.

Offline

Board footer

Powered by FluxBB