cleaning up text subtitles file for encore and after effects

A company send us some subtitles .txt files.
We are planning to use this with adobe encore.
We also using some of the subtiles in After Effects(with a script pt_importsubtitles) where we need to integrate it in a specific lay out/animation.

As we understood, encore and the script can import those files
when files look like this: