#1 2009-05-17 18:52

tenoko74
Member
Registered: 2009-05-17
Posts: 2

Rename files with brackets

I have files that are [blah]name_v1_chp3.zip and I want them to be name v01 c003 [blah].zip

would a script or a regex work to do this

Offline

#2 2009-05-17 19:54

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Rename files with brackets

Sure it would:

Regex:  (\[.+\])(.+)_v(\d)_chp(\d+)
Replace: $2 v0$3 c00$4 $1

The only problem is with number of zeros. If they may vary you might need more than one regex,eg. like these ones:

Regex:  ^(\[.+\])(.+)_v(\d)_chp(\d)$
Replace: $2 v0$3 c00$4 $1

Regex:  ^(\[.+\])(.+)_v(\d)_chp(\d{2})$
Replace: $2 v0$3 c0$4 $1

And remember to have "skip extention" ticked on.


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

Board footer

Powered by FluxBB