Remove text before hyphen in file name?

A swapping-ground for Regular Expression syntax

Remove text before hyphen in file name?

Postby Theshawty » Mon Aug 20, 2012 7:45 am

Ok, so I have a massive music collection, over 660 songs and they're all like this: n. Artist - Song

Where n. defines a number from 1 to 600+ plus a dot, like this: 3. Red Hot Chili Peppers - Californication

I somehow messed up the ID3 tags as well so the "title" in ID3 tag is the exact same as the filename, and the "artist" part too. I'd like a way to in the filename remove everything left of the hyphen and the hyphen itself so the filename only consists of the song's name, like this: Californication

I like it well-structured and if I set the filename to only be the title of the song, and I set the ID3 title to the title as well and set artist to, yeah, the artist, it'll look much nicer in music players. Get it?

Sorry for not being able to explain very well what I want. I do not natively speak English.
Theshawty
 
Posts: 1
Joined: Mon Aug 20, 2012 7:39 am

Re: Remove text before hyphen in file name?

Postby Stefan » Mon Aug 20, 2012 12:09 pm

Theshawty>> I'd like a way to in the filename remove everything left of the hyphen and the hyphen itself
so the filename only consists of the song's name, like this: Californication



FROM:
3. Red Hot Chili Peppers - Californication.ext
23. Red - Hot Chili - Peppers - Californication Two.ext
423. Red Hot Chili Peppers - Californication - Three.ext

TO:
Californication.ext
Californication Two.ext
Three.ext <==== !!!


Rule:
1.) get all to the last dash/space combination
2.) get all the following rest and store that in ()-group \1


Use:

RegEx:
Match: .+- (.+)
Repla: \1





.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions