Search code examples
notepad++

search for series of numbers and group them in notepad++


Here i have a long list of numbers that scene changes of a video.

Sometimes because of close up actions there are a series of number like this

19068:19069
19069:19070
19070:19071
19071:19072
19072:19073
19073:19074
19074:19075
19075:19076

and i want a way to search through the list and group the above example into

19068:19076

Any ideas?

cheers


Solution

  • As far as I understand, you want to delete numbers when they are equal at the end of a line and the beginning of next line.

    Here is a way to go:

    • Ctrl+H
    • Find what: :(\d+)\n\1
    • Replace with: LEAVE EMPTY
    • CHECK Wrap around
    • CHECK Regular expression
    • Replace all

    Explanation:

    :           # colon
    (\d+)       # group 1, 1 or more digit
    \n          # line feed, you can use \r\n for windows EOL or \R for any kind of linebreak
    \1          # backreference to group 1
    

    Screenshot (before):

    enter image description here

    Screenshot (after):

    enter image description here