#1 2025-02-03 21:28

Lauraq
Member
Registered: 2016-10-02
Posts: 98

Remove artist from name if is in the tag

Hi smile

Forgive me, I always have difficult questions smile

I have many flac that have a name like this:

02 - Marco Rovelli - Dromi fiore meu

in the tag as author there is Marco Rovelli, Paolo Monti

so when I import from the tag, the file name becomes

02 - Marco Rovelli - Dromi fiore meu (feat Marco Rovelli, Paolo Monti)

Can you tell me how to delete the author name that is already present and close the parenthesis, to have this:

02 - Marco Rovelli - Dromi fiore meu (feat Paolo Monti)

Many thanks

Offline

#2 2025-02-03 23:06

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

Re: Remove artist from name if is in the tag

Have you started learning the Regular Expressions yet? Yes??

Replace expression "\A(\d+\s+-\s+)(.+?)(\s+-\s+.*\(feat\s.*?)\s*\2[,\s]*" with "$1$2$3".

This won't be easy, but if you can decipher this one, you probably won't need more help.

Consider this to be your last gift, now go and study it. Next time you'll have to at least demonstrate an attempt at solving your own puzzle.

Offline

#3 2025-02-04 11:00

Lauraq
Member
Registered: 2016-10-02
Posts: 98

Re: Remove artist from name if is in the tag

you're right but, in my defense, I say that my problem is not the lack of commitment but the difficulty with languages that holds me back sad

then, if you want to do an experiment, translate the regular expressions page with Google Translate and have someone who doesn't know codes and various languages read it. I tried and I didn't understand anything.

About the solution you recommend, I'm probably wrong. I created a rule that says to insert
(feat :FLAC_Artist: -

and then I added your rule but it seems that the regular expression doesn't change anything.

However, I understand that I've bored you, so maybe I'll leave my request for help to someone else, thanks for everything you've done for me smile

Last edited by Lauraq (2025-02-04 11:16)

Offline

#4 2025-02-04 17:59

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

Re: Remove artist from name if is in the tag

A language barrier would make it exponentially more difficult to understand Regular Expressions.

However, you should be able to study it using a similar tutorial but in your native language. There are may different flavors of Regular Expressions engines, but 95% of the features would overlap and work the same. The most important thing is to understand how it works conceptually, the rest can be learned through trial and error.

Anyway, back to your original question.

The expression above will convert this:

  02 - Marco Rovelli - Dromi fiore meu (feat Marco Rovelli, Paolo Monti)

To this:

  02 - Marco Rovelli - Dromi fiore meu (feat Paolo Monti)

By removing the duplicates author name in the "feat" part. That's what you want to achieve?

Offline

#5 2025-02-04 18:26

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 356

Re: Remove artist from name if is in the tag

den4b wrote:

Have you started learning the Regular Expressions yet? Yes??

A little off-topic but can be very useful for people who want to learn RegExes.

I also had a various problems working with RegEx, how to resolve the issue that I had with renaming a lot of mp3 files that have same pattern, and then working with data extraction from API response bodies, etc. I told myself, I need to learn it once and for all! I've found various useful webpages about RegEx, but one reference helped me a lot, completely demystifying it.

One of the greatest tutorials that I have found about regular expressions is located at LinkedIn Learning - "Learning Regular Expressions" course by Kevin Skoglund. It is so clearly explained that almost everyone can understand it and create his RegEx without problems. I highly recommend watching it! It is not free, but it can be unlocked if you use a 1-month free trial of LinkedIn Premium.

Course details:

Regular expressions can speed up tedious tasks and streamline your workflow. They are an indispensable tool with programming languages like Java, JavaScript, Perl, Python, Ruby, C#, and more. In this course, instructor Kevin Skoglund goes over the definitions, details, and basic processes to start using regular expressions. Kevin explains what regular expressions are, what types are available in different programming languages, and what notations you should use. He dives into characters and character sets, then goes over how repetition is used with metacharacters, how it can be quantified, and more. He discusses grouping, alternation, and anchors. Kevin shows you how to capture content and create a backreference to the captured data. Plus, he covers positive and negative lookahead assertions, lookbehind assertions, and multiple lookaround assertions.

As suggestion "Useful references" section on ReNamer:Regular Expressions page can be updated by adding this course as learning source smile


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#6 2025-02-04 19:53

Lauraq
Member
Registered: 2016-10-02
Posts: 98

Re: Remove artist from name if is in the tag

den4b wrote:

A language barrier would make it exponentially more difficult to understand Regular Expressions.

However, you should be able to study it using a similar tutorial but in your native language. There are may different flavors of Regular Expressions engines, but 95% of the features would overlap and work the same. The most important thing is to understand how it works conceptually, the rest can be learned through trial and error.

Anyway, back to your original question.

The expression above will convert this:

  02 - Marco Rovelli - Dromi fiore meu (feat Marco Rovelli, Paolo Monti)

To this:

  02 - Marco Rovelli - Dromi fiore meu (feat Paolo Monti)

By removing the duplicates author name in the "feat" part. That's what you want to achieve?


No, I would like ReNamer to import the author's name from the flac tag. In this case the tag says:
Marco Rovelli, Paolo Monti
I would like ReNamer to import this tag but then eliminate the author's name that is already in the original name.

Going back to the previous discussion, allow me a consideration, you are extremely good at your job but you have to understand that here you are the only one who understands the things you talk about and yet everyone speaks English. When I look for some answers I search the forum and the only valid answers are yours. Maybe the problem is not my lack of commitment but overestimating who is here and underestimating the difficulty of the topic. If there were others you wouldn't be forced to answer a pain in the ass like me because maybe someone else would smile

edit:

Of course I don't want to offend all the kind people who often reply, if I have offended anyone I apologize immediately

Last edited by Lauraq (2025-02-04 19:55)

Offline

#7 2025-02-06 08:16

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

Re: Remove artist from name if is in the tag

Lauraq wrote:

No, I would like ReNamer to import the author's name from the flac tag. In this case the tag says:
  Marco Rovelli, Paolo Monti

I would like ReNamer to import this tag but then eliminate the author's name that is already in the original name.

I don't see the problem here.

Rule 1: Insert the :FLAC_Artist: tag.
Rule 2: Use the Regular Expressions rule to remove the duplicated author name in the "feat" section.

Maybe you can produce a complete example, including, original names, your rules, desired names, etc.

Offline

#8 2025-02-06 17:28

Lauraq
Member
Registered: 2016-10-02
Posts: 98

Re: Remove artist from name if is in the tag

den4b wrote:
Lauraq wrote:

No, I would like ReNamer to import the author's name from the flac tag. In this case the tag says:
  Marco Rovelli, Paolo Monti

I would like ReNamer to import this tag but then eliminate the author's name that is already in the original name.

I don't see the problem here.

Rule 1: Insert the :FLAC_Artist: tag.
Rule 2: Use the Regular Expressions rule to remove the duplicated author name in the "feat" section.

Maybe you can produce a complete example, including, original names, your rules, desired names, etc.


you're right, sorry, I copied the rule badly sad

I was thinking that maybe it's not the best solution for how I would like to organize the songs because the title becomes too long for me. So
do you know if it's possible to exclude the author if he is present in the folder name?
Basically I organize my music in this way:

folder: Marco Rovelli
    subfolder: year - albumtitle
           folder content: 02 - Marco Rovelli - Dromi fiore meu

to get
02 - Dromi fiore meu (feat Paolo Monti)

for now I have insert an only rule
insert      :FLAC_TrackNo: - :FLAC_Title: (feat :FLAC_Artist:)
and the option to delete the original name was checked

I imagine it's very complicated, just tell me if it's potentially possible and maybe I'll wait for someone to help me... thanks smile

Last edited by Lauraq (2025-02-06 23:55)

Offline

#9 2025-02-09 00:37

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

Re: Remove artist from name if is in the tag

Lauraq wrote:

So do you know if it's possible to exclude the author if he is present in the folder name?

Basically I organize my music in this way:

folder: Marco Rovelli
    subfolder: year - albumtitle
           folder content: 02 - Marco Rovelli - Dromi fiore meu

to get
02 - Dromi fiore meu (feat Paolo Monti)

You can do it with a Pascal Script rule:

var
  GrandparentFolder: WideString;
begin
  GrandparentFolder := WideExtractFileName(WideExtractFileDir(WideExtractFileDir(FilePath)));
  if Length(GrandparentFolder) > 0 then
    FileName := WideReplaceText(FileName, GrandparentFolder, '');
end.

This will replace all occurrences of grandparent folder name in the filename.

You can modify the script to handle the dashes too, or use a separate rule for that.

Offline

#10 2025-02-09 11:45

Lauraq
Member
Registered: 2016-10-02
Posts: 98

Re: Remove artist from name if is in the tag

Thank's...
I'm probably doing something wrong, for example:

The artist is Jake La Furia

original title:
11 - Let's go to the sea (feat. anice)

in the author's tag there is:

Jake La Furia, Anice, Night Skinny

I only put the rule insert
:FLAC_TrackNo: - :FLAC_Title: (feat :FLAC_Artist:)

checking the Replace current name item

but with your script it becomes:

11 - Let's go to the sea (feat. anice) (feat , Anice, Night Skinny)

So Anice is repeated, as if the Replace current name command doesn't work.

I'd like to point out that I downloaded the latest version of ReNamer but ctrl+up arrow to move the rules doesn't work, I went back to the previous one, I don't know if it's just me.

Thanks

Offline

Board footer

Powered by FluxBB