I have some files which look like this: beginning-php5-programmer-to-programmer.9780764557835.16953.chm professional-php5-programmer-to-programmer.9780764572821.26866.chm
What I'd like to do is 1)get rid of the numbers at the end, 2)convert the dashes to spaces and make the file name title case.
I have a couple of renaming presets to do that, the first one using regular expressions. I have tried to write a script to combine both these operations, without success. The Regular expression part beats me, and I don't have a clue as to what is going wrong.
How far did you get? If you only need help with the correct VBScript regex syntax and are happy to modify the existing Title Case and/or Multiple-Reg Ex rename scripts then it's an easy question to answer, but if you need an entire script writing and testing then it'll take more time, of course.
As I wrote earlier, I have made two presets, one for replacing the numbers, and one for the dashes, or more precisely, hyphens. I am adding a couple of snapshots. Don't know how that will work out though. I am new to posting on forums.
The first one uses a regexp for removing the numbers, and a checkbox selection for converting to upper case (not the ideal procedure I think).
The second one simply does a Standard search and replace for hyphens and converts them to spaces.
Function pCase(strIn)
strOut = ""
boolUp = True
For i = 1 To Len(strIn)
c = Mid(strIn, i, 1)
if c = " " or c = "'" or c = "-" then
strOut = strOut & c
boolUp = True
Else
If boolUp Then
tc = Ucase(c)
Else
tc = LCase(c)
End If
strOut = strOut & tc
boolUp = False
End If
Next
pCase = strOut
End Function
[/code] amitava.orp (1.12 KB)