Batch processing out of order subtitles - Annalal37/linux_system_administrator GitHub Wiki

At first, my original learning videoes look like this and my subtitles look like this. There are many issues I have encountered and I have to think out a way to solve them automatically.

https://github.com/Annalal37/linux_system_administrator/blob/master/video.jpg https://github.com/Annalal37/linux_system_administrator/blob/master/original_subtitles.jpeg https://github.com/Annalal37/linux_system_administrator/blob/master/original_subtitle_example.jpeg

1.There are enormous videos and subtitles but they are seperated. 2.VLC Player needs us to match subtitles with videos manually. 3.Some of their names are not totally same. 4.All of them are very short so it wastes time and very easy to make mistakes if we rename all of the files and copy & paste manually.

So I think about writing a bash to batch processing those subtitles out-of-order. Here are the steps: 1.we should find the similar pattern between videos and subtitles in sub-file folders. 2.Use regex expression and using loop to select videos which have the same partial pattern with the subtitles. 3.Copy videos matching the subtitles to the relative file folders and rename videos using relative subtitles' name.

At last, the right video set should be like this. We can play videos and see subtitles automatically!!! https://github.com/Annalal37/linux_system_administrator/blob/master/final_videos.jpeg