qq751588386 发表于 2009-9-8 18:06

教大家用本站的几个ogg版最新字幕转换出wav版字幕!!!

本帖最后由 qq751588386 于 2009-9-8 18:08 编辑

首先要新建一个txt文本文件,接着复制下面文本,粘贴到新建的txt
' 批量替换文件名称
' author : avill
' upate:2006.2.28
'
Dim NewLine
NewLine = vbcrlf
TabStop = ""
function isFolderExists(fso,folderPath)
if folderPath = empty then exit function
If not FSO.FolderExists(folderPath) Then
   msgbox "foloder not exists!please try agian"
   folderPath = InputBox("批量替换文件名称"& vbcrlf &"请输入路径[绝对路径],为空则自动退出","")
   call isFolderExists(fso,folderPath)   
end if
end function
Function doRepWord(Files,filePath,repWord,resWord)
    Dim S,file,count,newName
      repWord = split(repWord,";")
      count = 0
      Set fso = CreateObject("Scripting.FileSystemObject")
      For Each File In Files
          for each repStr in repWord
         if instr(File.Name,repStr)<>0 then
             newName = replace(file.name,repStr,resWord)
             If not fso.FileExists(filePath&"\"&newName) Then
                'msgBox "exists"            
                file.name = newName
                count = count + 1
             end if
         end if
          next
      Next
    doRepWord = count
End Function
sub reName()
dim s,folderPath,repWord,resWord
folderPath = "F:\Exercise\xhtml_info\taobao_images"
folderPath = ""
folderPath = InputBox("批量替换文件名称"& vbcrlf &"请输入路径[绝对路径]","")


Set fso = CreateObject("Scripting.FileSystemObject")
call isFolderExists(fso,folderPath)
if folderPath = empty then exit sub
repWord = InputBox("希望要替换掉的字符,多个字符请用分号[;]隔开!","")
resWord = InputBox("希望将字符替换为:!","")

Set Folder = FSO.GetFolder(folderPath)
Set Files = Folder.Files

If 1 = Files.Count Then
   S = S & "There is 1 file" & NewLine
Else
   S = S & "There are " & Files.Count & " files" & NewLine
End If
If Files.Count <> 0 Then
   s = s & "replace files:" & doRepWord(Files,folderPath,repWord,resWord) &NewLine
End If
msgbox s

end sub
call reName()
然后把文件名改为rename.vbs

到这里就算完成了,下面教大家如何使用
双击打开,输入字幕目录如E:\illusion\ag3\data\SUBS→确定,输入ogg→确定,输入wav→确定
由于文件太多,需要耐心等待一段时间

民工甲 发表于 2009-9-8 19:27

问一下txt文本文件是什么啊....?

fanwingx 发表于 2009-9-9 15:39

我又学多一招了。
页: [1]
查看完整版本: 教大家用本站的几个ogg版最新字幕转换出wav版字幕!!!