Help with Actions, Regular Expression

Hello all, I'm very new to the program, and wanted to see if someone can explain Regular Expressions a bit. I just don't know where to start, I'm not asking for a class, but just a little clarity.

This is what I'm trying to do.. I have a file that is named,

AZ - Problems (Radio).mp3

Now what I'd like to do with this file is Change (Radio) to (Clean) and then set the Genre as HipHop Clean. Pulling Clean from (Clean).

So say if the file was AZ - Problems (Dirty), I'd want to have the Genre set to HipHop Dirty and so on.

I think If I have an example, I could half way figure it out how to start doing some of this.

Any Takers,

Thanks

Are you sure, that you want a pure 'regular expression solution'?
Did you ever have tried the standard scripting functions, converter and actions to solve the task?

DD.20130130.1843.CET

At this point, I'm not sure on how to do it. I will look to see what I can find. If there is an easier way, I surely would prefer that... Thanks..

You may try to apply this group of actions ...

Begin Action Group Test_2013#20130130.mrclasik

Action #1
Actiontype 7: Import tag fields (guess values)
Source format __: %_FILENAME%
Guessing pattern: %TMP_PART1% - %TMP_PART2% (%TMP_PART3%)

Action #2
Actiontype 5: Format value
Field ______: _FILENAME
Formatstring: %TMP_PART1%' - '%TMP_PART2%' (Clean)'

Action #3
Actiontype 7: Import tag fields (guess values)
Source format __: %_FILENAME%
Guessing pattern: %TMP_PART1% - %TMP_PART2% (%TMP_PART3%)

Action #4
Actiontype 5: Format value
Field ______: GENRE
Formatstring: 'HipHop '%TMP_PART3%

Action #5
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TMP_PART1;TMP_PART2;TMP_PART3

End Action Group Test_2013#20130130.mrclasik (5 Actions)

DD.20130130.1900.CET

You may try to apply this group of actions ...

Begin Action Group Test_2013#20130130.mrclasik (2)

Action #1
Actiontype 2: Replace
Field ______: _FILENAME
Original ___: (Radio)
Replace with: (Clean)

[X] Only as whole word [X] Case sensitive comparison

Action #2
Actiontype 7: Import tag fields (guess values)
Source format __: %_FILENAME%
Guessing pattern: %TMP_PART1% - %TMP_PART2% (%TMP_PART3%)

Action #3
Actiontype 5: Format value
Field ______: GENRE
Formatstring: 'HipHop '%TMP_PART3%

Action #4
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TMP_PART1;TMP_PART2;TMP_PART3

End Action Group Test_2013#20130130.mrclasik (2) (4 Actions)

DD.20130130.1911.CET

Thank you much, I will work with this to see if I can get it working and learn what it's doing.

Another Question. Is there a way to scan in the title for say (Clean), (Dirty), so on. I guess this is where the Regex would come in handy. Thanks in advance.

MrClasik

What do you mean by that? Filter?
%title% HAS Clean OR %title% HAS Dirty
Or Replace?
So the question in return is "scan and then do what?"

What I'm trying to do is Take what's in the title, and append it to the Genre. For instance, from my record pools, I get a file; 50 Cent - Major Distribution (Clean).mp3. The way i've been doing it, is a two - three part process. But I'd like to get it into an action, to take that (Clean) and append it to the Gere HipHop so the genre would be Hiphop Clean or HipHop Dirty, based on the title. As well, (Instrumental) and so forth. If I get an idea of how it's done, this would save a ton of time.

Thanks

Because you got already examples to solve the task, we are now at a point to clarify what tag-fields are really in usage ...

  • real tag-field GENRE="HipHop" ... already set.
  • real tag-field TITLE="" ... what content?
  • pseudo tag-field _FILENAME="50 Cent - Major Distribution (Clean)"

... does tag-field TITLE contain the same value as the filename or does TITLE not exist?
... should tag-field TITLE be set with a new value? ... what value?
... existing tag-field GENRE should be changed by adding the genre specifier, which has to be extracted from the round bracket clamb at the right edge from the filename (resp. from the tag-field TITLE ?), to set the value e. g. from GENRE="HipHop" to GENRE="HipHop Clean"?

Please report where do you get stuck.

If you want to see how a regular expression can help ...
... this regular expression extracts the content from the round bracket clamb at the right edge of the filename ('genre specifier') out of the filename ...

$regexp(%_filename%,'^.+?\s\((.+?)\)$','$1')

From:
50 Cent - Major Distribution (Clean)
To:
Clean

Other example ...
Converter: "Tag - Tag" ... or ... Action: "Format value"
Field: GENRE
Format string: %GENRE%' '$mid(%TITLE%,$add($strrchr(%TITLE%,'('),1),$sub($sub($strrchr(%TITLE%,')'),$strrchr(%TITLE%,'(')),1))

From:
TITLE=50 Cent - Major Distribution (Clean)
GENRE=HipHop
To:
TITLE=50 Cent - Major Distribution (Clean)
GENRE=HipHop Clean

DD.20130131.1200.CET

I'm looking at the File name.. The Genre, Artist and Title Tags would already be set. Title tag matches filename after the Artist followed by the - . Thanks for all your help.. I will look at this and try to get it to work.. You've given something to work with.

Clasik

Thank DetLevD, I'm starting to get a half way understanding. Long way to go, but very helpful..