#1 2011-06-02 22:32

Rusherman
Member
Registered: 2011-06-02
Posts: 8

Trying to clean up garbage at the front of my filename

I would like a script that could clean up the beginning of my file names.
I would like to remove everything at the beginning of my file names till I reach the first (a-b) (A-B)
I have some files with numbers dashes and the like at the front of the names that screw up finding anything alphabetically.
It seems strait forward but I am woefully ignorant of reg-ex script writing.

I am not complaining about the program. It is the best renamer I have found.
Out of the box it handles about 95% of what I need to do to my files. It does clean up the spaces at both ends of the filename.

I hope I explained this properly and any help would be appreciated.

Ps I am using the beta as the ability to easily flip first and last name is fantastic.

Offline

#2 2011-06-03 09:57

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Trying to clean up garbage at the front of my filename

Try this:

RegEx Rule
Expression: ^[^A-Za-z]+(.+)$
Replace: $1
[X] skip extension

That means:
match one-ore-more of all signs which are not A-Z. And then capture the rest, starting at first found A-Z,
replacing by what is cached inside the ()-group  only with "$1" symbol.

RegEx works only for standard english characters. If one needs to match unicode, accents or umlautes, we have to write an PascalScript.


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2011-06-03 17:09

Rusherman
Member
Registered: 2011-06-02
Posts: 8

Re: Trying to clean up garbage at the front of my filename

Thank you Stefan. That works a treat on all the files I tried it on. It cleans them up and makes them easier to find. If there is a non alphabetical against the first letter (no space) it does change that letter to a small letter on me. That is not a problem though as I can run the files twice to clean that up. My bad I just moved the Capitalize every word below your expression and it works fine. I am more than a bit rusty at this and really appreciate your help.

Offline

#4 2011-06-03 20:34

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Trying to clean up garbage at the front of my filename

Fine it works and many thanks for the feedback big_smile
If you are able please help Denis too (see my sig)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB