Simple text replacement between two files



  • Hi!

    I have two subtitle files and I need to import only SOME of the timecodes from one of them. Because only some are correct.

    I’m using a notepad and the timecodes look like this:

    136
    00:08:59,665 --> 00:09:03,502
    Hello!

    So, I was thinking about just manually selecting some lines and then substitute them with the corresponding line according to the same subtitle number in the other file.

    Is that possible?

    Thanks!



  • @Valentina-Roldós ,

    If they really have same number of lines, I would suggest:

    • open both source and destination (or whatever your files are called)
    • right click on the destination tab and Move to Other View, so they are side-by-side
    • Ctrl+Home in both, to make sure it’s at the top on both (so they are lined up to begin with)
    • enable View > Synchronize Vertical Scrolling
    • Loop on:
      • in source, search / scroll down to the subtitle number you want to grab; the destination should have scrolled to the one you want to replace
      • select and copy the block from source and paste in destination
      • repeat until all the ones you want to change have been changed

    If there are slight differences in length (for example, if source has some subtitle entries that are two lines of text vs just one line of text for the corresponding destination side – but that most of the subtitle text and timestamps are the same), then I suggest installing the Compare Plugin – because then it will take care of lining up the portions that match, and it will highlight the portions that are different, and it makes it easy to navigate from one difference to the next, and copy from the source to the destination.



  • Hi, Peter,

    No, they don’t have the same number of lines unfortunately. Otherwise it would be just one step with my subtitling software.
    One file has 1120 subtitles and the other one 1357.
    This is something that subtitling software can’t do. So, I thought about manually and visually selecting lines individually and then managing to do the replacement in some way.
    Can I adapt your solution in that case?

    Thanks!



  • @Valentina-Roldós ,

    One file has 1120 subtitles and the other one 1357.

    Compare Plugin might still work, depending on how many similarities there are, even if there are a different number of subtitles. But don’t be surprised if it’s not good enough.

    Can I adapt your solution in that case?

    You can still open the two files side-by-side with the “other view” option – just don’t enable Synchronize Vertical Scrolling– and then manually search on both the source and destination panes to the place you want to grab from and paste to.

    Not much I can suggest other than that.



  • Great! Thanks so much!


Log in to reply