Remove elements of an EDL text file, perform arithmetic on other parts

亡梦爱人 提交于 2019-12-06 20:53:26

Remember the previous line in a separate variable when reading the file:

Do Until oFile.AtEndOfStream
    line = oFile.ReadLine
    'At this point the variable prev either is empty (during the first loop
    'cycle) or holds the content of the previous line.
    If Left(line, 19) = "* FROM CLIP NAME:  " Then
        'do stuff here
    End If
    prev = line
Loop

Use a regular expression for extracting start and end timestamps.

Set re = New RegExp
re.Pattern = "        (\d{2}:\d{2}:\d{2}:\d{2}) (\d{2}:\d{2}:\d{2}:\d{2})"
Set matches = re.Execute(prev)

The timestamps are available as the first and second submatch of matches.

Beware, however, that some of the FROM CLIP NAME lines in your input file don't seem to be preceded by timestamp lines, so you'll need to handle that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!