regular expression question


#1

for example if i have "%artist% - %title%" or "%track% - %title%" in the title field and i would like to just have %title% in the title field, how can i:

a)use a regular expression to convert it to just "%title%" in the title field. or,

b)use a regular expression to convert title field to display %title% AND also move %artist% or %track% to their fields.

either is fine, but i am just wondering if b ) is possible.

Or is there an easier way.

(I'm a regular at the winamp tech support forums and i always recomend mp3tag for winamp users, but i do not know the answer to this question, so i thought i would ask)


#2

Good question. I usually do it manually (track by track/copy paste). I would also like to know if there is an eaier way. Hopefully Florian or someone else will be able to answer this question.


#3

Use an action which guesses values and type in "%_filename%" as source format and "%artist% - title%" or "%track% - %title%" as format string.

Either use a format value action after doing the above step and use "_FILENAME" as field and "%title%" as format string, or use a regular expression action with "_FILENAME" as field, "(.) - (.)" as RegEx and "$2" as replacement.

Hope it helps. :slight_smile:


#4

Sebastian, I don't think that %_filename% is needed there, because he has the values in the title field.

Just use an action Format value for field TITLE with a formatstring like %dummy% - %title%

Just use an action Guess value with %title% as source format and a guessing pattern like %artist% - %title% or %track% - %title%

Best regards,
~ Florian


#5

Oops... I thought he has that info in the file name, sorry.
I shouldn't sit in front of the PC 5 minutes after waking up. :stuck_out_tongue:


#6

Thanks Florian and Sebastian for the help. I never knew that there was a string called %dummy%. It just made things much easier.


#7

thanks....that was a lot easier than i had anticipated :smiley: