Help - Search - Members - Calendar
Full Version: Remove Part of the File name, after the "-"
Mp3tag Forums > Mp3tag - International > Support
monet60707
Hi,

Can you help me with Regular Expressions? I want to remove part of the file name after the dash "-" e.g. Depeche Mode - People Are People should become just Depeche Mode. I figured out the way to do it with single words e.g. Europe - Carrie (becomes Europe) but it does not work with 2-worded bands.
And also how would i do it the other way around, meaning to remove the band before the "-" but leave the song title (e.g. Depeche Mode - People Are People should become just People Are People)?
Any help is much appreciated.

Peter J.
ohrenkino
ZITAT(monet60707 @ Jan 20 2012, 05:08) *
Hi,

Can you help me with Regular Expressions? I want to remove part of the file name after the dash "-" e.g. Depeche Mode - People Are People should become just Depeche Mode. I figured out the way to do it with single words e.g. Europe - Carrie (becomes Europe) but it does not work with 2-worded bands.
And also how would i do it the other way around, meaning to remove the band before the "-" but leave the song title (e.g. Depeche Mode - People Are People should become just People Are People)?
Any help is much appreciated.

Peter J.

Use the converter "Filename - FIlename".
Enter as mask for the original filename:
%1 - %2
Enter as mask for the target filename (if you want to keep the first part):
%1
Enter as mask for the target filename (if you want to keep the second part):
%2

The Preview function in the dialogue should give you a hint whether the mask fits.
monet60707
QUOTE (ohrenkino @ Jan 20 2012, 00:57) *
Use the converter "Filename - FIlename".
Enter as mask for the original filename:
%1 - %2
Enter as mask for the target filename (if you want to keep the first part):
%1
Enter as mask for the target filename (if you want to keep the second part):
%2

The Preview function in the dialogue should give you a hint whether the mask fits.


Thanx ohrenkino!

It does the trick for me. Really appreciate you taking the time to solve this.
Steve Holiday
QUOTE (monet60707 @ Jan 20 2012, 10:06) *
Thanx ohrenkino!

It does the trick for me. Really appreciate you taking the time to solve this.



On a similar note can I do something similar for a tag field, such as album?
Obviously I can do a regular Exp, but didn't want to miss something simpler like above.

For example I have Album with something like this:

Year - Conductor - Album Name

I want to convert it to JUST the album name and get rid of the "Year - Conductor - " part.

Thanks!!!!!!!!!!!!!

I was using GUESS VALUES with

%album%
to
%year% - %conductor% - %album%

----

What I didn't like is that it replaced my year and conductors with that, I'd rather keep my values, I was hoping for something like %dummy% - %dummy% - %album%.

thanks.
ohrenkino
ZITAT(Steve Holiday @ Jan 21 2012, 20:34) *
On a similar note can I do something similar for a tag field, such as album?
Obviously I can do a regular Exp, but didn't want to miss something simpler like above.

For example I have Album with something like this:

Year - Conductor - Album Name

I want to convert it to JUST the album name and get rid of the "Year - Conductor - " part.

Thanks!!!!!!!!!!!!!

I am afraid not.
Or - you could do a "Replace with Regular Expression"
Input-Mask:
.* - (.*)
Replace string:
$1
This should get rid of everything up to the last hyphen.
Steve Holiday
QUOTE (ohrenkino @ Jan 21 2012, 12:43) *
I am afraid not.
Or - you could do a "Replace with Regular Expression"
Input-Mask:
.* - (.*)
Replace string:
$1
This should get rid of everything up to the last hyphen.



Great one!! Very simple, thanks so much.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.