VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. So, in a bit of an interesting situation here. I have two sets of subtitles, the originals, and one which I case converted, spell-checked and did auto-line break for in SubtitleEdit. Basically, I regret auto-line breaking, and want to revert those changes while keeping my spell check.

    Is there a way to copy just how the lines are broken from one .srt to another? Or, alternatively, can I compare/replace each subtitle on a case by case basis using the two .srt files? Really trying to avoid having to spell-check/case convert again. Thanks!
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Just do a spell check on the original srt,it will go faster cause subtitle edit remembers previous spell checks.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Unfortunately we’re talking about around 150 episodes of a TV show here. Would really prefer to not have to re-check if possible
    Quote Quote  
  4. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    There's no simple way to redo the line breaks so you gotta redo all of them.
    I think,therefore i am a hamster.
    Quote Quote  
  5. Could be done more easily by comparing each pair of files with WinMerge. (I've searched if there was an option to reproduce line breaks from one file to another, couldn't find anything relevant.)

    Perhaps it could be done even more quickly with an advanced text editor like TEDNotepad or Notepad++, using search and replace with “regular expression” syntax. I tested the following with TEDNotepad.
    – Merge both files of each pair into a single text file. (Could be done with a batch script.)
    – For the first half of the merged file, corresponding to the first (original) file, add a “-01” suffix to the subtitle number, and replace line breaks by a distinctive character sequence, anything that is not going to be present in any of those files, like “###”.
    Search : ^(\d+)$\n^(.+ --> .+)$\n^(.+)$\n^(.+)$
    Replace : \1-01\t\2\t\3###\4
    – For the second half of the merged file, corresponding to the second (spell-checked) file, add a “-02” suffix and replace line breaks by spaces.
    Search : ^(\d+)$\n^(.+ --> .+)$\n^(.+)$\n^(.+)$
    Replace : \1-02\n\2\n\3 \4
    – Sort lines by number (ascending order) ; with the suffix added to subtitles' numbers, the first line of each pair should correspond to the first file.
    – Then use matching groups to reproduce the position of the line break placeholder in the first line into the second line.
    Search : ^(\d+)-01\t(.+)###(.+)$\n^\1-02\t\2 \3
    Replace : \1-01\t\2###\3\n\1-02\t\2###\3
    – Then remove the first line of each pair and recreate the original structure.
    Search : ^(\d+)-01\t(.+ --> .+)\t(.+)###(.+)$\n^\1-02\t\2\t\3###\4
    Replace : \1\n\2\n\3\n\4\n

    ...BUT I realize just now that this will work only for lines which were not modified, lines which were modified would have to be checked manually, but with that many files it would still save quite a lot of time. Perhaps there's a clever trick that could make this work also with modified lines, can't think of anything else right now.
    I have less experience with Notepad++ but it should process regular expressions in the same way, and has the ability to process multiple files at once.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!