How do i replace something but also keep it? Notepad++

34 views Asked by At
Document1:Document2
Document3:Document4
Document5:Document6
Document20:Document21
Document22:Document23
Document24:Document25

So, i wanna split from the sixth document so it would look like this,

Document1:Document2
Document3:Document4
Document5:Document6

Document20:Document21
Document22:Document23
Document24:Document25

But, how can i \n without deleting this? "Document5:Document6"

1

There are 1 answers

0
Toto On
  • Ctrl+H
  • Find what: Document5:Document6
  • Replace with: $0\n or $0\r\n depending on your needs
  • check Wrap around
  • check Regular expression
  • Replace all

Explanation:

Document5:Document6     : literally

Replacement:

$0          : The whole match (i.e. Document5:Document6)
\n          : line feed

Result for given example:

Document1:Document2
Document3:Document4
Document5:Document6

Document20:Document21
Document22:Document23
Document24:Document25