vill kolla igenom en sträng om den innehåller 2 eller fler siffror irad och replace'a dom med '' (inget alltså)
och sedan få in den i denna koden efter alla mina andra replace
<body bgcolor="#333333" text="#FFFFFF">
<%
Function ProperCase(Value)
ProperCase = UCase(Left(Value, 1)) & LCase(Mid(Value, 2))
End Function
Dim countOk, countChanged
countOk = + 0
countChanged = 0
Sub ShowFiles(ByRef objFS, ByRef lngFiles, ByRef lngFolders, ByRef lngSize, ByVal strPath)
' lokala variabler
Dim objThisFolder, objFile, objFolder, orgName, tmpName, strName, arrName
' skapa ett objekt för mappen vi är i
Set objThisFolder = objFS.GetFolder(strPath)
' loopa igenom alla mappar i mappen
For each objFolder in objThisFolder.SubFolders
' visa allt i en undermapp
Call ShowFiles(objFS, lngFiles, lngFolders, lngSize, strPath & "\" & objFolder.Name)
Next
' loopa igenom alla filer i mappen
For each objFile in objThisFolder.Files
orgName = objFile.Name
strName = objFile.Name
tmpName = "tempMp3Name.mp3"
strName = Replace(strName, "rmx", "Remix", 1, -1, vbTextCompare)
strName = Replace(strName, "remix", "Remix")
strName = Replace(strName, "ft.", "feat.")
strName = Replace(strName, "featuring", "feat.")
strName = Replace(strName, "featuring.", "feat.")
strName = Replace(strName, " And ", "&")
strName = Replace(strName, " and ", "&")
strName = Replace(strName, "_", " ")
strName = Replace(strName, " - ", "-")
strName = Replace(strName, "-", " - ")
arrName = Split(strName)
For i = 0 To UBound(arrName)
arrName(i) = ProperCase(arrName(i))
Next
strName = Join(arrName)
If orgName = strName Then
countOk = countOk + 1
Else
countChanged = countChanged + 1
objFile.Name = tmpName
objFile.Name = strName
Response.Write "<font face=""verdana"" size=""1"" color=""#EEEEEE"">" & objThisFolder & "\" & orgName & ""
Response.Write "<font color=""#FF0000""> -> </font><font color=""#EEEEEE"">" & strName & "</font><br>" & vbCrLf
End If
Next
End Sub
Dim objFS
Set objFS=Server.CreateObject("Scripting.FileSystemObject")
Call ShowFiles(objFS, lngFiles, lngFolders, lngSize, "c:\Mp3")
Set objFS = Nothing
response.write "<font face=""verdana"" size=""1"" color=""#EEEEEE""><b>Done</b></font>"
%>
(jag antar att regexp är det bästa sättet?)