Community
    • Login

    How to make punctuation correctly in SRT file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mohamed MohamedM
      Mohamed Mohamed
      last edited by

      I have noticed that there are a lot of ellipses (…) in my SRT file and I want to check if it is correct needs to have ellipses if not then remove it and replace it with a new punction when needed.

      This is what I have done so far from another community.
      069d41cd-d183-4fa1-bd19-bbbfd3602748-image.png

      PeterJonesP CoisesC 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Mohamed Mohamed
        last edited by PeterJones

        @Mohamed-Mohamed ,

        You are in SEARCH MODE = “Normal”, so no characters have special meaning… which means you are searching for the literal text (...), but since none of your ellipses have parentheses in your text, it will not match.

        If you want parentheses to mean “make a group”, you have to be in SEARCH MODE = “Regular Expression” search mode. But in Regular Expression mode, . means “any character” not just a period – so (...) will match any series of three characters and put it in group#1, which is not what you want. If you want to match a literal . in Regular Expression mode, you have to escape it by using \.

        So your choices are to stay in SEARCH MODE = “Normal” mode, then you should be searching for ... not (...) ; or you should switch to SEARCH MODE = “Regular Expression”, and change your search to (\.\.\.)

        Mohamed MohamedM 1 Reply Last reply Reply Quote 1
        • Mohamed MohamedM
          Mohamed Mohamed @PeterJones
          last edited by

          @PeterJones
          Ok, it has found the ellipse that the first I want now what should I replace it with if I want to add punctuation? Some of them have “?”, “!” and contain nothing after “…”.

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Mohamed Mohamed
            last edited by PeterJones

            @Mohamed-Mohamed said in How to make punctuation correctly in SRT file:

            @PeterJones
            Ok, it has found the ellipse that the first I want now what should I replace it with if I want to add punctuation? Some of them have “?”, “!” and contain nothing after “…”.

            Very few characters have special meaning in most replacements, so if you want to replace your ellipsis with a question mark, the replacement is simply ? – if you wanted to replace all ellipses with question mark, then, you could just hit Replace All… but the way you phrased it makes it sound like you have a mental rule for when to replace with each different replacement. If you could describe your mental rule, someone might be able to turn it into a complicated find/replace pair that would do it in one single Replace All – but if you’ve just got a vague internal rule then my suggestion would be: set up FIND as previous described, set REPLACE to ?, then do FIND NEXT, and make a mental decision each time whether to hit REPLACE on that instance to do the replacement, or FIND NEXT to skip that one and go to the next; when done with all the ? replacements, then change Replace With to ! and do the same Find Next / Replace to decide which of them need to be an exclamation point, etc.)

            Mohamed MohamedM 1 Reply Last reply Reply Quote 1
            • Mohamed MohamedM
              Mohamed Mohamed @PeterJones
              last edited by

              @PeterJones Done with “!” and “?” What about replacing it with a full stop or comma? The rule is that if there are ellipses following with capital letters then put a full stop, but if it was non-capital then put the comma.

              PeterJonesP 1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Mohamed Mohamed
                last edited by

                @Mohamed-Mohamed ,

                You do not need to ask me individually for every character you might want to replace. The easiest is to try it, and if it doesn’t work, undo.

                When I said “Very few characters have special meaning in most replacements”, I was trying to imply that you weren’t going to have difficulty with any of your punctuation replacements.

                In regex mode, if your replacement has ( followed by ), it won’t include the literal parentheses, and if it has backslash \ followed by other stuff, it won’t necessarily replace with a literal backslash… but for just about anything you’re going to try, it’s going to work. If you want to learn more about what is special during a regular expression replacement, see the User Manual: Regular Expression > Substitutions section, which shows all the “special” sequences; anything not listed there will replace exactly as you expect.

                Mohamed MohamedM 1 Reply Last reply Reply Quote 1
                • Mohamed MohamedM
                  Mohamed Mohamed @PeterJones
                  last edited by

                  @PeterJones Ok thanks

                  1 Reply Last reply Reply Quote 0
                  • CoisesC
                    Coises @Mohamed Mohamed
                    last edited by

                    @Mohamed-Mohamed Just a thought: have you checked to see if the Fix common errors feature in Subtitle Edit, with proper adjustment at Options | Settings… | Tools | Edit settings for fixing continuation style… | Edit custom continuation style… can do what you want more easily? I haven’t used those settings, so I can’t advise in any detail, but it is a purpose-built tool for editing and correcting subtitles.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors