If you want to reprint please indicate the source: http://blog.csdn.net/itas109
QQ Technology Group: 129518033
After downloading the video of NetEase public class, it is found that the Chinese and English letters are separate, and when they are opened with other players, they can only load a subtitle, so they want to merge 2 files.
Ideas:
Assume that the English caption of the file named 1.srt, the Chinese title of the file named 2.srt, the new merged file named 3.SRT. Assume a starting behavior of 1.
Reads each row in 1.SRT, synchronously reads each row in 2.srt, and writes 1.srt of data to 3.SRT, and writes data read in 2.SRT to 3.SRT when the value of the row count to 4 is found to be 3 o'clock.
Note: There may be extra blank lines in the Chinese subtitles of netease public course, resulting in merge errors.
Solution: With notepad++ first out of Chinese subtitles, in the replacement, find the mode select "Expand", find the content of "\r\n\r\n\r\n", replace the content "\r\n\r\n". (or try to find the content "\nn\n" and replace it with "\ n").
Processing part of the code:
while (Fgets (S,100,FP1)!=null) {fgets (S1,100,FP2); Fwrite (S,getlen (s), 1,FP3); Count++;if (count%4 = 3) {fwrite (S1, Getlen (S1), 1,fp3); line++;}}
Full code Download:
http://download.csdn.net/detail/itas109/8477269
If you want to reprint please indicate the source: http://blog.csdn.net/itas109
QQ Technology Group: 129518033
NetEase Public Course in English subtitle file merge code