Help with capitalization case

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Help with capitalization case

Postby nocannothave » Mon Apr 09, 2012 6:20 pm

Because I'm an idiot, I feel the need to rename files where the words a, an, the, and, but, or, nor, for, yet, so, as, at, by, for, in, of, to, and from are currently capitalized and should not be.

I have used Bulk Rename Utility for MANY years, and it almost does the job in this situation. Obviously, I can easily rename to "Title" with exceptions for the above words, but it allows words like 'All or And or Am' to be made lower case. So (I think) it needs to ignore words that don't explicitly match the Excep. list.

Is this possible? Much thanks if you can help!

Examples:

I have Case (4) set to Title, with Excep. field containing: a: an: the: and: but: or: nor: for: yet: so: as: at: by: for: in: of: to: from:

05 - Down In A Hole.mp3 renames to 05 - Down in a Hole.mp3 :D

but

06 - Angry Chair.mp3 renames to 06 - angry Chair.mp3 :cry:
nocannothave
 
Posts: 3
Joined: Thu Jun 02, 2011 3:21 am

Re: Help with capitalization case

Postby nocannothave » Wed Apr 11, 2012 7:17 am

I managed to get my desired results by using MP3Tag and these Actions:

Action type: Replace with regular expression
Field: _TAG
Regular expression: ([-({\[\]}) _",./+&@:;*])(\l)
Replace matches with: $1$upper($2)
[x] case-sensitive comparison

Action type: Format value
Field: _FILENAME
Formatstring: $regexp(%_filename%,'([-({\[\]}) _",./+&@:;*])(\l)',$1\u$2)

Action type: Replace with regular expression
Field: _All
Regular expression: ^(\l)
Replace matches with: $upper($1)
[x] case-sensitive comparison

Followed by...

Action type: Replace with regular expression
Field: _ALL
Regular expression: (?<![/\-:;\(\)\[\]{}])\s(a|an|the|and|but|or|nor|for|yet|so|as|at|by|for|in|of|to|from)(?=\s)(?!\s[\-\(\)\[\]{}])
Replace matches with: $lower($0)
[ ] case-sensitive comparison

Action type: Replace with regular expression
Field: _ALL
Regular expression: (^|\s|\(|\[|/)'(.{1})
Replace matches with: $1'$upper($2)
[ ] case-sensitive comparison
nocannothave
 
Posts: 3
Joined: Thu Jun 02, 2011 3:21 am


Return to BRU Support