去掉字幕文件裏的時間軸信息

因爲常常看美劇,想好好研究臺詞,下載下來的中英文字幕文件裏含有時間軸信息,用了一些軟件好比EditLRC等,都不能正確的將字幕(srt,ass等)轉換成沒有時間的文本文件。在word裏面終於倒騰出了,有兩種方法。工具

 

方法一:oop

1. 將字幕文件用文本編輯軟件打開,複製粘貼到word裏。spa

2. Alt+F11調出VBA編輯工具,F7打開代碼窗口(【視圖】——【代碼窗口】)。3d

3. 代碼以下,寫好後運行或者保存。code

Sub mmm()
    Application.ScreenUpdating = False
    Selection.EndKey Unit:=wdStory
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Do
    If Asc(Selection.Text) = 13 Then
        Selection.TypeBackspace
    ElseIf Selection.Text Like "##:##:##,### --> ##:##:##,###*" Then
        Selection.TypeBackspace
        Selection.MoveUp Unit:=wdLine, Count:=1
    ElseIf IsNumeric(Mid(Selection.Text, 1, Len(Selection.Text) - 1)) = True Then
        Selection.TypeBackspace
        Selection.MoveUp Unit:=wdLine, Count:=1
    Else
        Selection.MoveUp Unit:=wdLine, Count:=1
    End If
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Loop Until (Selection.Information(wdFirstCharacterLineNumber) = 1 And Selection.Information(wdActiveEndPageNumber) = 1)
    Application.ScreenUpdating = True
End Sub


方法二:orm

1. 將字幕文件用文本編輯軟件打開,複製粘貼到word裏。blog

2. 把^p^p所有替換爲+it

3. 把^p所有替換爲=io

4. 把+所有替換爲^pform

5. 全選——【插入】——【表格】——【文本轉換成表格】

6. 刪除多餘的列。最後效果:

相關文章
相關標籤/搜索