Community
    • Login

    Remove empty lines and timestamp from subtitle file in Notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.8k 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.
    • Adrian WoodsA
      Adrian Woods
      last edited by

      i want remove empty lines and timestamp from subtitle file in Notepad++

      I know this question has already been asked and the answer is this code: ^[\d\s\n].*\n

      But if at the beginning of the text is a number, That line is also deleted.

      For example, on the following lines:

      1- We’ve already seen better ways to organise our code

      2- we’ve seen ways to deal with files,

      1
      00:00:01.876 --> 00:00:02.709
      <v Instructor>We can go back now</v>

      2
      00:00:02.709 --> 00:00:05.042
      to our web server checklist.

      3
      00:00:06.410 --> 00:00:08.722
      1- We’ve already seen better ways to organise our code

      4
      00:00:08.722 --> 00:00:11.545
      into reusable pieces with modules,

      5
      00:00:11.545 --> 00:00:13.315
      2- we’ve seen ways to deal with files,

      6
      00:00:13.315 --> 00:00:15.940
      both synchronous and asynchronous,

      7
      00:00:15.940 --> 00:00:16.773
      and buffers,

      8
      00:00:16.773 --> 00:00:18.325
      both the built-in Node one

      9
      00:00:18.325 --> 00:00:20.380
      and the ES6 buffers,

      10
      00:00:20.380 --> 00:00:22.485
      and we’ve seen a way to deal with work

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Adrian Woods
        last edited by

        @Adrian-Woods said:

        i want remove empty lines and timestamp from subtitle file in Notepad++

        If I remove lines in a replacement by matching them with this regex: ^\R|^\d\d:.+\R, I am left with this:

        1- We’ve already seen better ways to organise our code
        2- we’ve seen ways to deal with files,
        1
        <v Instructor>We can go back now</v>
        2
        to our web server checklist.
        3
        1- We’ve already seen better ways to organise our code
        4
        into reusable pieces with modules,
        5
        2- we’ve seen ways to deal with files,
        6
        both synchronous and asynchronous,
        7
        and buffers,
        8
        both the built-in Node one
        9
        and the ES6 buffers,
        10
        and we’ve seen a way to deal with work```
        
        If that's not what you asked for, learn to ask better, or better yet, show exact "after" text that you want to achieve.
        1 Reply Last reply Reply Quote 3
        • Adrian WoodsA
          Adrian Woods
          last edited by

          Thank you very much

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