回复 5# wxyz0001
Python代码- with open('E:\\news\\字幕.txt', 'r', encoding='gbk') as f:
- file = f.readlines()
- str_ = ""
- for i in range(0, len(file), 4):
- str_ += '{0}\n{1} --> {2}{3}\n'.format(str(int((i + 4) / 4)), file[i].strip('\n'), file[i+1], file[i+2])
- with open('E:\\news\\字幕b.txt', 'w', encoding='gbk') as ff:
- ff.write(str_)
复制代码
|