新用户登入 登录

萌子岛

  • 752
  • 2

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

3粉丝
qq751588386 中级居民2009-9-8 18:06 显示全部楼层 |阅读模式
本帖最后由 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→确定
由于文件太多,需要耐心等待一段时间

评分

参与人数 1经验 +10 M币 +8 +7 +8 收起 理由
dable + 10 + 8 + 7 + 8 不错不错,贡献有奖

查看全部评分

8粉丝
民工甲 中级居民2009-9-8 19:27 显示全部楼层
问一下txt文本文件是什么啊....?
回复 支持 反对

使用道具 举报

2粉丝
fanwingx 中级居民2009-9-9 15:39 显示全部楼层
我又学多一招了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 新用户登入

小黑屋|萌子岛

GMT+8, 2025-2-2 22:43 , Processed in 0.315947 second(s), 29 queries , Gzip On, MemCache On.

Copyright 2020  atollmoe©.a2.1.0 All rights reserved. 9+

Copyright 2009  supported by zhixuan© oeo© oko© All rights reserved.Thank you!

快速回复 返回顶部 返回列表