Help with trimming leading characters


#1

Hi guys,

I tried to follow the tutorial to remove leading characters but it doesn't seem to work when I try it. It only works on some files. I am currently using:

Replace with regular expression
Field: _FILENAME
Reg. Expression: ^\s*\d+\s*-\s*
Replace matches with:

But I still have many files left with:
01 myfilename

  1. myfilename
    100 myfilename

Etc.

How do I remove everything before the starting "myfilename". I had it on my old machine but reinstalled without backing up my actions.

I'm also looking to find how to remove underscores, and also trim the end of the file for anything after the hyphen (-) but before the .mp3

Sorry to ask but had no luck with the search.

Thanks


#2

An all in-one solution would be:

Reg. Expression: ^\s*\d*\s*.-\s*

Notice i've only added:
.* which matches the . litlerally between 0 and an unlimited amount of times
and a * quantifier to the - which again will look for that character 0-unlimted times.

Or you can use:
^[^a-zA-Z]+

This removes anything other than a-z or A-Z from the ^ which anchors to the beginning of the string.

Replace _ can be done with the a simple replace function

Removing before the extension and after the last - is:
Field: _FILENAME
Expression: (.+)\s*-[^-]+(..{3,4})$
Replace with: $1$2


#3

Thank you so much!